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.

skip eval split and HF split detection when eval_steps is disabled

Roland Tannous2be29338460a
diff --git a/studio/backend/core/training/trainer.py b/studio/backend/core/training/trainer.py
index ff5b66485ab..d433d2575a2 100644
--- a/studio/backend/core/training/trainer.py
+++ b/studio/backend/core/training/trainer.py
@@ -343,7 +343,8 @@ class UnslothTrainer:
custom_format_mapping: dict = None,
subset: str = None,
train_split: str = "train",
- eval_split: str = None) -> Optional[tuple]:
+ eval_split: str = None,
+ eval_steps: float = 0.00) -> Optional[tuple]:
"""
Load and prepare dataset for training.
@@ -358,6 +359,7 @@ class UnslothTrainer:
dataset = None
eval_dataset = None
has_separate_eval_source = False # True if eval comes from a separate HF split
+ eval_enabled = eval_steps is not None and eval_steps > 0
if local_datasets:
# Load local datasets
@@ -410,23 +412,26 @@ class UnslothTrainer:
print(f"Loaded dataset from Hugging Face: {dataset_source}\n")
# Resolve eval split from a separate HF split (explicit or auto-detected)
- if eval_split:
- # Explicit eval split provided - load it directly
- print(f"Loading explicit eval split: '{eval_split}'\n")
- eval_load_kwargs = {"path": dataset_source, "split": eval_split}
- if subset:
- eval_load_kwargs["name"] = subset
- eval_dataset = load_dataset(**eval_load_kwargs)
- has_separate_eval_source = True
- print(f"Loaded eval split '{eval_split}' with {len(eval_dataset)} rows\n")
- else:
- # Auto-detect eval split from HF (returns a separate dataset, or None)
- eval_dataset = self._auto_detect_eval_split_from_hf(
- dataset_source=dataset_source,
- subset=subset,
- )
- if eval_dataset is not None:
+ if eval_enabled:
+ if eval_split:
+ # Explicit eval split provided - load it directly
+ print(f"Loading explicit eval split: '{eval_split}'\n")
+ eval_load_kwargs = {"path": dataset_source, "split": eval_split}
+ if subset:
+ eval_load_kwargs["name"] = subset
+ eval_dataset = load_dataset(**eval_load_kwargs)
has_separate_eval_source = True
+ print(f"Loaded eval split '{eval_split}' with {len(eval_dataset)} rows\n")
+ else:
+ # Auto-detect eval split from HF (returns a separate dataset, or None)
+ eval_dataset = self._auto_detect_eval_split_from_hf(
+ dataset_source=dataset_source,
+ subset=subset,
+ )
+ if eval_dataset is not None:
+ has_separate_eval_source = True
+ else:
+ print("Eval disabled (eval_steps <= 0), skipping eval split detection\n")
if dataset is None:
raise ValueError("No dataset provided")
@@ -472,7 +477,7 @@ class UnslothTrainer:
)
eval_dataset = eval_info["dataset"]
print(f"Eval dataset formatted successfully\n")
- elif not has_separate_eval_source:
+ elif eval_enabled and not has_separate_eval_source:
# No separate eval source — split the already-formatted dataset
formatted_dataset = dataset_info["dataset"]
split_result = self._resolve_eval_split_from_dataset(formatted_dataset)
diff --git a/studio/backend/core/training/training.py b/studio/backend/core/training/training.py
index f5d9be63c11..9123d36b395 100644
--- a/studio/backend/core/training/training.py
+++ b/studio/backend/core/training/training.py
@@ -223,6 +223,7 @@ class TrainingBackend:
subset=subset,
train_split=train_split,
eval_split=eval_split,
+ eval_steps=eval_steps,
)
# Unpack: load_and_format_dataset returns (dataset, eval_dataset)
@@ -232,10 +233,6 @@ class TrainingBackend:
dataset = dataset_result
eval_dataset = None
- # If user set eval_steps to 0, disable evaluation entirely
- if eval_steps is not None and float(eval_steps) <= 0:
- eval_dataset = None
-
# Track whether eval is enabled for status reporting
self.eval_enabled = eval_dataset is not None