fix: skip streaming when dataset_slice_start > dataset_slice_end

Prevents training on the wrong row range when start exceeds end by
falling back to full download where existing clamping handles it.
This commit is contained in:
Roland Tannous 2026-03-10 20:21:23 +00:00
commit 21ef22a9ff

View file

@ -1871,7 +1871,10 @@ class UnslothTrainer:
if subset:
load_kwargs["name"] = subset
if dataset_slice_end is not None and dataset_slice_end >= 0:
_slice_start = dataset_slice_start or 0
if (dataset_slice_end is not None
and dataset_slice_end >= 0
and dataset_slice_end >= _slice_start):
# Manual slice — stream only the rows we need instead of
# downloading the entire dataset.
rows_to_stream = dataset_slice_end + 1