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.

Studio: report first-step training and gradient accumulation (#15480)

Daniel Han4ac4e9137d5c
diff --git a/studio/backend/core/training/startup_progress.py b/studio/backend/core/training/startup_progress.py
new file mode 100644
index 00000000000..b43ff9515c5
--- /dev/null
+++ b/studio/backend/core/training/startup_progress.py
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+"""Truthful first-step milestones shared by SFT, vision, audio, decision and embedding callbacks."""
+
+STARTING = "Starting training loop..."
+ACTIVE = "Training in progress..."
+WAITING_FOR_LOSS = "First training step finished. Waiting for the first loss measurement..."
+
+
+class TrainingStartupProgress:
+ def __init__(self):
+ self.started = False
+ self.start_step = 0
+ self.accumulation = 1
+ self.batches = 0
+ self.step_finished = False
+ self.loss_reported = False
+
+ def begin(self, args, state):
+ self.started = True
+ self.start_step = state.global_step
+ self.accumulation = max(1, int(getattr(args, "gradient_accumulation_steps", 1) or 1))
+ self.batches = 0
+ self.step_finished = False
+ self.loss_reported = False
+ return STARTING
+
+ def step_begin(self):
+ if not self.started or self.step_finished or self.loss_reported:
+ return None
+ return self._batch_status()
+
+ def substep_end(self):
+ if not self.started or self.step_finished or self.loss_reported:
+ return None
+ self.batches += 1
+ return self._batch_status()
+
+ def _batch_status(self):
+ batch = min(self.batches + 1, self.accumulation)
+ return (
+ f"Running first training step (batch {batch} of up to {self.accumulation})... "
+ "Loss appears after the optimizer step."
+ )
+
+ def step_end(self, state):
+ if not self.started or self.step_finished or state.global_step <= self.start_step:
+ return None
+ self.step_finished = True
+ return None if self.loss_reported else WAITING_FOR_LOSS
+
+ def log(self, logs):
+ if not self.started or self.loss_reported or logs.get("loss") is None:
+ return None
+ self.loss_reported = True
+ return ACTIVE
diff --git a/studio/backend/core/training/trainer.py b/studio/backend/core/training/trainer.py
index 7e509038c66..0a6534ff7a8 100644
--- a/studio/backend/core/training/trainer.py
+++ b/studio/backend/core/training/trainer.py
@@ -872,8 +872,10 @@ class UnslothTrainer:
def _create_progress_callback(self):
"""Create a TrainerCallback for progress tracking. Reused by all training branches."""
from transformers import TrainerCallback
+ from core.training.startup_progress import TrainingStartupProgress
trainer_ref = self
+ startup = TrainingStartupProgress()
class _ProgressCallback(TrainerCallback):
# Throttled republish: without HF's tqdm bar a long eval looks stalled after the last step log.
@@ -884,10 +886,17 @@ class UnslothTrainer:
trainer_ref.session_start_step = state.global_step
if state.global_step > 0:
trainer_ref.training_start_time = time.time()
- # on_log reports an empty status, else the UI stays on "Starting training...".
if trainer_ref.should_stop:
return
- trainer_ref._update_progress(status_message = "Training in progress...")
+ trainer_ref._update_progress(status_message = startup.begin(args, state))
+
+ def on_step_begin(self, args, state, control, **kwargs):
+ if not trainer_ref.should_stop and (message := startup.step_begin()):
+ trainer_ref._update_progress(status_message = message)
+
+ def on_substep_end(self, args, state, control, **kwargs):
+ if not trainer_ref.should_stop and (message := startup.substep_end()):
+ trainer_ref._update_progress(status_message = message)
def on_evaluate(self, args, state, control, **kwargs):
cls = type(self)
@@ -983,7 +992,7 @@ class UnslothTrainer:
eval_loss = logs.get("eval_loss", None),
is_run_summary = is_run_summary,
offload = trainer_ref._offload_snapshot(),
- status_message = "",
+ status_message = "" if trainer_ref.should_stop else startup.log(logs) or "",
)
def on_epoch_end(self, args, state, control, **kwargs):
@@ -996,6 +1005,8 @@ class UnslothTrainer:
logger.info(f"Stop detected at step {state.global_step}\n")
control.should_training_stop = True
return control
+ if message := startup.step_end(state):
+ trainer_ref._update_progress(status_message = message)
return _ProgressCallback()
diff --git a/studio/backend/core/training/worker.py b/studio/backend/core/training/worker.py
index bda8d024131..621b4ee368e 100644
--- a/studio/backend/core/training/worker.py
+++ b/studio/backend/core/training/worker.py
@@ -5542,6 +5542,9 @@ def _create_embedding_progress_callback(
"""TrainerCallback that reports embedding training progress to the parent. ``should_stop`` is
polled in on_train_begin and on_step_end, so a stop signal arriving mid-run is seen."""
from transformers import TrainerCallback
+ from core.training.startup_progress import TrainingStartupProgress
+
+ startup = TrainingStartupProgress()
class _EmbeddingProgressCallback(TrainerCallback):
_start_step = 0
@@ -5551,10 +5554,17 @@ def _create_embedding_progress_callback(
self._start_step = state.global_step
if state.global_step > 0:
self._training_start_time = time.time()
- # Progress events carry an empty status, else the parent keeps showing "Starting...".
if should_stop():
return
- _send_status(event_queue, "Training in progress...")
+ _send_status(event_queue, startup.begin(args, state))
+
+ def on_step_begin(self, args, state, control, **kwargs):
+ if not should_stop() and (message := startup.step_begin()):
+ _send_status(event_queue, message)
+
+ def on_substep_end(self, args, state, control, **kwargs):
+ if not should_stop() and (message := startup.substep_end()):
+ _send_status(event_queue, message)
def on_log(
self,
@@ -5605,7 +5615,7 @@ def _create_embedding_progress_callback(
"grad_norm": logs.get("grad_norm"),
"num_tokens": getattr(state, "num_input_tokens_seen", None),
"eval_loss": logs.get("eval_loss"),
- "status_message": "",
+ "status_message": "" if should_stop() else startup.log(logs) or "",
"ts": time.time(),
}
)
@@ -5615,6 +5625,8 @@ def _create_embedding_progress_callback(
logger.info("Embedding training: stop at step %d", state.global_step)
control.should_training_stop = True
return control
+ if message := startup.step_end(state):
+ _send_status(event_queue, message)
return _EmbeddingProgressCallback()
diff --git a/studio/backend/tests/test_training_progress_callback.py b/studio/backend/tests/test_training_progress_callback.py
index 918cbc6b94d..54601a8d716 100644
--- a/studio/backend/tests/test_training_progress_callback.py
+++ b/studio/backend/tests/test_training_progress_callback.py
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
-"""Progress callbacks must report an active status: the parent only overwrites a non-empty one."""
+"""Callbacks distinguish loop startup from measured training; the parent preserves non-empty statuses."""
from __future__ import annotations
@@ -69,6 +69,7 @@ if not _TRAINER_PRE_IMPORTED:
sys.modules.pop("core.training", None)
ACTIVE = "Training in progress..."
+STARTING = "Starting training loop..."
class _FakeQueue:
@@ -116,17 +117,16 @@ def _make_owner():
return owner
-def test_train_begin_reports_active_status():
+def test_train_begin_reports_loop_entry_before_any_loss():
owner = _make_owner()
callback = owner._create_progress_callback()
callback.on_train_begin(None, _state(), SimpleNamespace())
- assert owner.training_progress.status_message == ACTIVE
+ assert owner.training_progress.status_message == STARTING
def test_logging_reports_an_empty_status_so_the_active_one_is_sent_once():
- # The parent keeps the last non-empty status, so a run costs one status event.
owner = _make_owner()
reported: list[str] = []
owner.add_progress_callback(lambda progress: reported.append(progress.status_message))
@@ -134,7 +134,7 @@ def test_logging_reports_an_empty_status_so_the_active_one_is_sent_once():
_drive(owner._create_progress_callback(), steps = 3)
assert owner.training_progress.status_message == ""
- assert [status for status in reported if status] == [ACTIVE]
+ assert [status for status in reported if status] == [STARTING, ACTIVE]
assert owner.training_progress.step == 3
assert owner.training_progress.loss == pytest.approx(1 / 3)
assert owner.training_progress.num_tokens == 384
@@ -232,6 +232,7 @@ def test_stop_status_is_never_replaced_by_the_active_one(stop_status):
backend._handle_event(event)
assert [e["message"] for e in event_queue.events if e["type"] == "status"] == [
+ STARTING,
ACTIVE,
stop_status,
]
@@ -316,7 +317,7 @@ def test_embedding_parent_status_advances_over_the_whole_chain():
assert [e["message"] for e in event_queue.events if e["type"] == "status"] == [
"Starting embedding training...",
- ACTIVE,
+ STARTING,
]
assert backend._progress.status_message == ACTIVE
assert backend._progress.step == 3
@@ -365,3 +366,31 @@ def test_embedding_resumed_run_eta_uses_the_steps_done_in_this_session():
assert backend._progress.eta_seconds == pytest.approx(540, rel = 0.02)
assert backend._progress.session_start_step == 900
assert backend._progress.elapsed_seconds == 60
+
+
[email protected]("kind", ["sft", "decision_embedding"])
+def test_first_step_reports_accumulation_then_waits_for_the_first_loss(kind):
+ event_queue = _FakeQueue()
+ if kind == "sft":
+ owner = _make_owner()
+ owner.add_progress_callback(_create_trainer_progress_callback(event_queue))
+ callback = owner._create_progress_callback()
+ else:
+ callback = _make_embedding_callback(event_queue)
+ args = SimpleNamespace(gradient_accumulation_steps = 4)
+ state, control = _state(), SimpleNamespace(should_training_stop = False)
+ callback.on_train_begin(args, state, control)
+ callback.on_step_begin(args, state, control)
+ for _ in range(3):
+ callback.on_substep_end(args, state, control)
+ assert not [e for e in event_queue.events if e.get("loss") is not None]
+ state.global_step = 1
+ callback.on_step_end(args, state, control)
+ statuses = [e["message"] for e in event_queue.events if e["type"] == "status"]
+ assert statuses[0] == STARTING
+ assert [f"batch {i} of up to 4" in statuses[i] for i in range(1, 5)] == [True] * 4
+ assert "Waiting for the first loss measurement" in statuses[-1]
+ callback.on_log(args, state, control, logs = {"loss": 0.0})
+ progress = [e for e in event_queue.events if e["type"] == "progress"][-1]
+ assert progress["loss"] == 0.0
+ assert progress["status_message"] == ACTIVE
diff --git a/studio/backend/tests/test_training_startup_progress.py b/studio/backend/tests/test_training_startup_progress.py
new file mode 100644
index 00000000000..225d8cb6883
--- /dev/null
+++ b/studio/backend/tests/test_training_startup_progress.py
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+from types import SimpleNamespace
+
+from core.training.startup_progress import (
+ ACTIVE,
+ STARTING,
+ WAITING_FOR_LOSS,
+ TrainingStartupProgress,
+)
+
+
+def _start(step = 0, accumulation = 4):
+ progress = TrainingStartupProgress()
+ assert (
+ progress.begin(
+ SimpleNamespace(gradient_accumulation_steps = accumulation),
+ SimpleNamespace(global_step = step),
+ )
+ == STARTING
+ )
+ return progress
+
+
+def test_accumulation_batches_advance_before_the_first_optimizer_step():
+ progress = _start()
+ assert "batch 1 of up to 4" in progress.step_begin()
+ for batch in (2, 3, 4):
+ assert f"batch {batch} of up to 4" in progress.substep_end()
+ assert progress.step_end(SimpleNamespace(global_step = 1)) == WAITING_FOR_LOSS
+ assert progress.step_begin() is None
+ assert progress.substep_end() is None
+ assert progress.step_end(SimpleNamespace(global_step = 2)) is None
+
+
+def test_resumed_step_is_measured_relative_to_the_session():
+ progress = _start(step = 900, accumulation = 1)
+ assert "batch 1 of up to 1" in progress.step_begin()
+ assert progress.step_end(SimpleNamespace(global_step = 900)) is None
+ assert progress.step_end(SimpleNamespace(global_step = 901)) == WAITING_FOR_LOSS
+
+
+def test_first_loss_clears_startup_once_including_zero_loss():
+ progress = _start()
+ assert progress.log({"eval_loss": 2.0}) is None
+ assert progress.log({"train_loss": 1.0}) is None
+ assert progress.log({"loss": 0.0}) == ACTIVE
+ assert progress.log({"loss": 0.5}) is None
+ assert progress.step_end(SimpleNamespace(global_step = 1)) is None
+ assert progress.step_begin() is None
+
+
+def test_partial_accumulation_may_finish_before_the_target_batch_count():
+ progress = _start(accumulation = 4)
+ assert "up to 4" in progress.step_begin()
+ progress.substep_end()
+ assert progress.step_end(SimpleNamespace(global_step = 1)) == WAITING_FOR_LOSS
+ assert progress.log({"loss": 1.0}) == ACTIVE
+
+
+def test_callbacks_before_train_begin_do_not_claim_active_training():
+ progress = TrainingStartupProgress()
+ assert progress.log({"eval_loss": 1.0}) is None
+ assert progress.log({"loss": 1.0}) is None
+ assert progress.step_begin() is None
+ assert progress.substep_end() is None
+ assert progress.step_end(SimpleNamespace(global_step = 10)) is None
+ assert (
+ progress.begin(
+ SimpleNamespace(gradient_accumulation_steps = 4), SimpleNamespace(global_step = 0)
+ )
+ == STARTING
+ )
+ assert "batch 1 of up to 4" in progress.step_begin()
+ assert progress.log({"eval_loss": 1.0}) is None
+ assert progress.log({"loss": 1.0}) == ACTIVE
diff --git a/studio/frontend/src/features/studio/preparation-progress.ts b/studio/frontend/src/features/studio/preparation-progress.ts
index fbee3f48055..226d862e703 100644
--- a/studio/frontend/src/features/studio/preparation-progress.ts
+++ b/studio/frontend/src/features/studio/preparation-progress.ts
@@ -17,12 +17,19 @@ const PREPARATION_PHASES = new Set<TrainingPhase>([
"configuring",
]);
+// Mirrors core/training/startup_progress.py; only trainer callbacks emit these.
+export function hasTrainingLoopStarted(message: string): boolean {
+ return /^(?:starting training loop|running first training step|first training step finished|training in progress)\b/i.test(message.trim());
+}
+
// The worker reports `training` once the trainer is built, with dataset mapping still ahead.
export function shouldShowPreparationStatus(
phase: TrainingPhase,
currentStep: number,
isStarting: boolean,
+ message = "",
): boolean {
+ if (hasTrainingLoopStarted(message)) return false;
if (isStarting) return true;
return (
PREPARATION_PHASES.has(phase) || (phase === "training" && currentStep <= 0)
diff --git a/studio/frontend/src/features/studio/training-start-overlay.tsx b/studio/frontend/src/features/studio/training-start-overlay.tsx
index 1c6ebd6283a..d895a28c751 100644
--- a/studio/frontend/src/features/studio/training-start-overlay.tsx
+++ b/studio/frontend/src/features/studio/training-start-overlay.tsx
@@ -36,6 +36,7 @@ import {
} from "@/features/studio/download-state";
import {
classifyPreparation,
+ hasTrainingLoopStarted,
parsePreparationProgress,
shouldShowPreparationStatus,
type PreparationProgress,
@@ -322,8 +323,16 @@ export function TrainingStartOverlay({
startFromResume && /^download/i.test(message)
? t("studio.trainingStart.resumingTraining")
: message || t("studio.trainingStart.startingTraining");
- const rawModelDownload = useModelDownloadProgress(modelName, hfToken);
- const rawDatasetDownload = useDatasetDownloadProgress(datasetName, hfToken);
+ // Resources are loaded once the loop runs; the cache scan's file subset would fake a download.
+ const trainingLoopStarted = hasTrainingLoopStarted(message);
+ const rawModelDownload = useModelDownloadProgress(
+ trainingLoopStarted ? null : modelName,
+ hfToken,
+ );
+ const rawDatasetDownload = useDatasetDownloadProgress(
+ trainingLoopStarted ? null : datasetName,
+ hfToken,
+ );
const modelDownload = coerceCachedStateReady(rawModelDownload);
const datasetDownload = coerceCachedStateReady(rawDatasetDownload);
// The raw message: a resumed run rewrites statuses to "resuming training".
@@ -331,6 +340,7 @@ export function TrainingStartOverlay({
phase,
currentStep,
isStarting,
+ message,
)
? parsePreparationProgress(message, t("studio.trainingStart.preparing"))
: null;
@@ -419,19 +429,21 @@ export function TrainingStartOverlay({
<AnimatedSpan className="my-2">
<pre className="whitespace-pre text-muted-foreground inline-block">{`==((====))==\n \\\\ /|\nO^O/ \\_/ \\\n\\ /\n "-____-"`}</pre>
</AnimatedSpan>
- <TypingAnimation duration={44}>
- {t("studio.trainingStart.preparingResources")}
- </TypingAnimation>
- <TypingAnimation duration={44}>
- {t("studio.trainingStart.gettingReady")}
- </TypingAnimation>
+ {/* Direct children: Terminal sequences by child and a Fragment never reports done. */}
+ {!trainingLoopStarted && (
+ <TypingAnimation duration={44}>
+ {t("studio.trainingStart.preparingResources")}
+ </TypingAnimation>
+ )}
+ {!trainingLoopStarted && (
+ <TypingAnimation duration={44}>
+ {t("studio.trainingStart.gettingReady")}
+ </TypingAnimation>
+ )}
<AnimatedSpan className="mt-2 text-muted-foreground">
- {t("studio.trainingStart.waitingForFirstStep", {
- message: displayMessage,
- step: currentStep,
- })}
+ &gt; {displayMessage}
</AnimatedSpan>
- {datasetStreaming ? (
+ {!trainingLoopStarted && (datasetStreaming ? (
<>
<AnimatedSpan className="mt-3 text-muted-foreground">
{t("studio.trainingStart.datasetStreaming")}
@@ -457,8 +469,8 @@ export function TrainingStartOverlay({
preparation={datasetPreparation}
/>
</AnimatedSpan>
- ) : null}
- {resourceRowHasContent(modelDownload, modelPreparation) ? (
+ ) : null)}
+ {!trainingLoopStarted && resourceRowHasContent(modelDownload, modelPreparation) ? (
<AnimatedSpan className="mt-3">
<ResourceRow
label={t("studio.trainingStart.modelWeights")}
diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.ts
index 3e46d80bcab..da343bb4aed 100644
--- a/studio/frontend/src/i18n/locales/ar.ts
+++ b/studio/frontend/src/i18n/locales/ar.ts
@@ -4203,7 +4203,6 @@ export const ar = {
terminalStart: "> يبدأ تدريب Unsloth...",
preparingResources: "> جارٍ تحضير النموذج ومجموعة البيانات...",
gettingReady: "> نُجهّز كل شيء لعملية التدريب...",
- waitingForFirstStep: "> {message} | في انتظار الخطوة الأولى... ({step})",
resumingTraining: "جارٍ استئناف التدريب...",
startingTraining: "جارٍ بدء التدريب...",
dataset: "مجموعة البيانات",
diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.ts
index 3d4680da0cc..5e28fd7db27 100644
--- a/studio/frontend/src/i18n/locales/de.ts
+++ b/studio/frontend/src/i18n/locales/de.ts
@@ -4277,8 +4277,6 @@ export const de = {
terminalStart: "> Unsloth-Training beginnt...",
preparingResources: "> Modell und Datensatz werden vorbereitet...",
gettingReady: "> Wir bereiten alles für Ihren Lauf vor...",
- waitingForFirstStep:
- "> {message} | warte auf ersten Schritt... ({step})",
resumingTraining: "Training wird fortgesetzt...",
startingTraining: "Training wird gestartet...",
dataset: "Datensatz",
diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.ts
index 89ecb8fc60a..6702922a883 100644
--- a/studio/frontend/src/i18n/locales/en.ts
+++ b/studio/frontend/src/i18n/locales/en.ts
@@ -4256,7 +4256,6 @@ export const en = {
terminalStart: "> unsloth training starts...",
preparingResources: "> Preparing model and dataset...",
gettingReady: "> We are getting everything ready for your run...",
- waitingForFirstStep: "> {message} | waiting for first step... ({step})",
resumingTraining: "Resuming training...",
startingTraining: "starting training...",
dataset: "Dataset",
diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.ts
index 46de3fab366..a9a885a8c22 100644
--- a/studio/frontend/src/i18n/locales/es.ts
+++ b/studio/frontend/src/i18n/locales/es.ts
@@ -4275,8 +4275,6 @@ export const es = {
preparingResources: "> Preparando modelo y conjunto de datos...",
gettingReady:
"> Estamos dejando todo listo para tu ejecución...",
- waitingForFirstStep:
- "> {message} | esperando el primer paso... ({step})",
resumingTraining: "Reanudando entrenamiento...",
startingTraining: "iniciando entrenamiento...",
dataset: "Conjunto de datos",
diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.ts
index a30bbc69537..145e4ab1d66 100644
--- a/studio/frontend/src/i18n/locales/fr.ts
+++ b/studio/frontend/src/i18n/locales/fr.ts
@@ -4288,8 +4288,6 @@ export const fr = {
terminalStart: "> l'entraînement unsloth démarre...",
preparingResources: "> Préparation du modèle et du jeu de données...",
gettingReady: "> Nous préparons tout pour votre entraînement...",
- waitingForFirstStep:
- "> {message} | en attente de la première étape... ({step})",
resumingTraining: "Reprise de l'entraînement...",
startingTraining: "démarrage de l'entraînement...",
dataset: "Jeu de données",
diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.ts
index b9780edb9e9..ad4573246d9 100644
--- a/studio/frontend/src/i18n/locales/he.ts
+++ b/studio/frontend/src/i18n/locales/he.ts
@@ -4323,7 +4323,6 @@ export const he = {
terminalStart: "> אימון unsloth מתחיל...",
preparingResources: "> מכין מודל ומערך נתונים...",
gettingReady: "> מכינים הכל לקראת ההרצה שלך...",
- waitingForFirstStep: "> {message} | ממתין לצעד ראשון... ({step})",
resumingTraining: "מחדש אימון...",
startingTraining: "מתחיל אימון...",
dataset: "מערך נתונים",
diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.ts
index 78dd267332c..a7a555ffd56 100644
--- a/studio/frontend/src/i18n/locales/hi.ts
+++ b/studio/frontend/src/i18n/locales/hi.ts
@@ -4214,7 +4214,6 @@ export const hi = {
terminalStart: "> unsloth ट्रेनिंग शुरू हो रही है...",
preparingResources: "> मॉडल और डेटासेट तैयार हो रहे हैं...",
gettingReady: "> हम आपके रन के लिए सब कुछ तैयार कर रहे हैं...",
- waitingForFirstStep: "> {message} | पहले स्टेप की प्रतीक्षा में... ({step})",
resumingTraining: "ट्रेनिंग फिर से शुरू हो रही है...",
startingTraining: "ट्रेनिंग शुरू हो रही है...",
dataset: "डेटासेट",
diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.ts
index ed7eae13675..75f0358150e 100644
--- a/studio/frontend/src/i18n/locales/it.ts
+++ b/studio/frontend/src/i18n/locales/it.ts
@@ -4278,7 +4278,6 @@ export const it = {
terminalStart: "> avvio dell'addestramento con Unsloth...",
preparingResources: "> Preparazione del modello e del dataset...",
gettingReady: "> Stiamo preparando tutto per il tuo run...",
- waitingForFirstStep: "> {message} | in attesa del primo step... ({step})",
resumingTraining: "Ripresa dell'addestramento...",
startingTraining: "avvio dell'addestramento...",
dataset: "Dataset",
diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.ts
index c4ffa66bee3..b1a85c904c1 100644
--- a/studio/frontend/src/i18n/locales/ja.ts
+++ b/studio/frontend/src/i18n/locales/ja.ts
@@ -4153,7 +4153,6 @@ export const ja = {
terminalStart: "> unsloth トレーニングを開始します...",
preparingResources: "> モデルとデータセットを準備中...",
gettingReady: "> 実行の準備を整えています...",
- waitingForFirstStep: "> {message} | 最初のステップを待機中... ({step})",
resumingTraining: "トレーニングを再開しています...",
startingTraining: "トレーニングを開始しています...",
dataset: "データセット",
diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.ts
index 40bc433158e..6861872f976 100644
--- a/studio/frontend/src/i18n/locales/ko.ts
+++ b/studio/frontend/src/i18n/locales/ko.ts
@@ -4194,7 +4194,6 @@ export const ko = {
terminalStart: "> unsloth 학습을 시작합니다...",
preparingResources: "> 모델과 데이터셋을 준비하는 중...",
gettingReady: "> 실행을 위한 모든 준비를 하는 중...",
- waitingForFirstStep: "> {message} | 첫 스텝을 기다리는 중... ({step})",
resumingTraining: "학습을 재개하는 중...",
startingTraining: "학습을 시작하는 중...",
dataset: "데이터셋",
diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.ts
index a47e39bfebf..877a13539ef 100644
--- a/studio/frontend/src/i18n/locales/pt-br.ts
+++ b/studio/frontend/src/i18n/locales/pt-br.ts
@@ -4237,7 +4237,6 @@ export const ptBR = {
terminalStart: "> treinamento do unsloth iniciado...",
preparingResources: "> Preparando modelo e dataset...",
gettingReady: "> Estamos deixando tudo pronto para a sua execução...",
- waitingForFirstStep: "> {message} | aguardando o primeiro passo... ({step})",
resumingTraining: "Retomando treinamento...",
startingTraining: "iniciando treinamento...",
dataset: "Dataset",
diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.ts
index 4f4687bf2b3..84a574f2efb 100644
--- a/studio/frontend/src/i18n/locales/ru.ts
+++ b/studio/frontend/src/i18n/locales/ru.ts
@@ -4235,7 +4235,6 @@ export const ru = {
terminalStart: "> обучение unsloth начинается...",
preparingResources: "> Подготовка модели и датасета...",
gettingReady: "> Мы готовим всё для вашего запуска...",
- waitingForFirstStep: "> {message} | ожидание первого шага... ({step})",
resumingTraining: "Продолжение обучения...",
startingTraining: "начало обучения...",
dataset: "Датасет",
diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.ts
index 01868296c41..6dedb68e156 100644
--- a/studio/frontend/src/i18n/locales/sv.ts
+++ b/studio/frontend/src/i18n/locales/sv.ts
@@ -4453,7 +4453,6 @@ export const sv = {
terminalStart: "> unsloth-träningen startar ...",
preparingResources: "> Förbereder modell och datauppsättning ...",
gettingReady: "> Vi förbereder allt för din körning ...",
- waitingForFirstStep: "> {message} | väntar på första steget ... ({step})",
resumingTraining: "Återupptar träning ...",
startingTraining: "startar träning ...",
dataset: "Datauppsättning",
diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.ts
index ac952546e4e..58665094a70 100644
--- a/studio/frontend/src/i18n/locales/zh-CN.ts
+++ b/studio/frontend/src/i18n/locales/zh-CN.ts
@@ -4105,7 +4105,6 @@ export const zhCN = {
terminalStart: "> Unsloth 训练开始...",
preparingResources: "> 正在准备模型和数据集...",
gettingReady: "> 正在为本次运行做好准备...",
- waitingForFirstStep: "> {message} | 正在等待首个训练步...({step})",
resumingTraining: "正在继续训练...",
startingTraining: "正在开始训练...",
dataset: "数据集",
diff --git a/studio/frontend/tests/training-start-preparation.test.ts b/studio/frontend/tests/training-start-preparation.test.ts
index 43caf2ce7dc..c9f6eeecaaf 100644
--- a/studio/frontend/tests/training-start-preparation.test.ts
+++ b/studio/frontend/tests/training-start-preparation.test.ts
@@ -8,6 +8,7 @@ import test from "node:test";
import {
classifyPreparation,
+ hasTrainingLoopStarted,
parsePreparationProgress,
resolvePreparationMessage,
shouldShowPreparationStatus,
@@ -257,3 +258,25 @@ test("one resource id being a prefix of the other does not steal the row", () =>
"dataset",
);
});
+
+
+test("real training milestones replace resource preparation without inventing compilation", () => {
+ for (const message of [
+ "Starting training loop...",
+ "Running first training step (batch 2 of up to 4)... Loss appears after the optimizer step.",
+ "First training step finished. Waiting for the first loss measurement...",
+ "Training in progress...",
+ ]) {
+ assert.equal(hasTrainingLoopStarted(message), true);
+ assert.equal(shouldShowPreparationStatus("training", 0, false, message), false);
+ }
+ for (const message of [
+ "Loading vision model...",
+ "Tokenizing dataset 50% (10/20)",
+ "Evaluating the base model on 50 held-out decisions...",
+ "Configuring training...",
+ ]) {
+ assert.equal(hasTrainingLoopStarted(message), false);
+ assert.equal(shouldShowPreparationStatus("training", 0, false, message), true);
+ }
+});