diff --git a/studio/backend/core/training/trainer.py b/studio/backend/core/training/trainer.py index c72a54af00..2e37cad189 100644 --- a/studio/backend/core/training/trainer.py +++ b/studio/backend/core/training/trainer.py @@ -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