Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

fix: guard against negative dataset_slice_end before streaming

Roland Tannous226f251589f9
diff --git a/studio/backend/core/training/trainer.py b/studio/backend/core/training/trainer.py
index 0c3aaa6aee9..c72a54af00d 100644
--- a/studio/backend/core/training/trainer.py
+++ b/studio/backend/core/training/trainer.py
@@ -1871,7 +1871,7 @@ class UnslothTrainer:
if subset:
load_kwargs["name"] = subset
- if dataset_slice_end is not None:
+ if dataset_slice_end is not None and dataset_slice_end >= 0:
# Manual slice — stream only the rows we need instead of
# downloading the entire dataset.
rows_to_stream = dataset_slice_end + 1