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.

data-recipe: recognize current sampling progress log line (#6760)

devangpratape16342ee2137
diff --git a/studio/backend/core/data_recipe/jobs/parse.py b/studio/backend/core/data_recipe/jobs/parse.py
index 8c2e8a4d55f..47f0f936d38 100644
--- a/studio/backend/core/data_recipe/jobs/parse.py
+++ b/studio/backend/core/data_recipe/jobs/parse.py
@@ -50,6 +50,11 @@ class ParsedUpdate:
_RE_SAMPLERS = re.compile(
r"Preparing samplers to generate (?P<rows>\d+) records across (?P<cols>\d+) columns"
)
+# Current data-designer phrasing for the same sampling stage (the line above is
+# kept for older builds). No column count is reported here, so only rows is set.
+_RE_SAMPLING_SEED = re.compile(
+ r"Sampling (?P<rows>\d+) records from .*?seed dataset", re.IGNORECASE
+)
_RE_COLCFG = re.compile(r"model config for column '(?P<col>[^']+)'")
_RE_PROCESSING_COL = re.compile(r"Processing .* column '(?P<col>[^']+)'")
_RE_PROGRESS = re.compile(
@@ -223,6 +228,13 @@ def parse_log_message(msg: str) -> ParsedUpdate | None:
cols = int(m.group("cols")),
)
+ m = _RE_SAMPLING_SEED.search(msg)
+ if m:
+ return ParsedUpdate(
+ stage = STAGE_SAMPLING,
+ rows = int(m.group("rows")),
+ )
+
if "Sorting column configs into a Directed Acyclic Graph" in msg:
return ParsedUpdate(stage = STAGE_DAG)
if "Running health checks for models" in msg:
diff --git a/studio/backend/tests/test_data_recipe_sampling_progress.py b/studio/backend/tests/test_data_recipe_sampling_progress.py
new file mode 100644
index 00000000000..822591bfce9
--- /dev/null
+++ b/studio/backend/tests/test_data_recipe_sampling_progress.py
@@ -0,0 +1,31 @@
+# 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 core.data_recipe.jobs.constants import STAGE_SAMPLING
+from core.data_recipe.jobs.parse import apply_update, parse_log_message
+from core.data_recipe.jobs.types import Job
+
+
+def test_current_sampling_log_sets_stage_and_rows():
+ # data-designer's current phrasing (seen in issue #5848 logs). Without this
+ # the sampling stage never fires and the row total used for overall progress
+ # is lost. The legacy "Preparing samplers ..." line is covered below.
+ update = parse_log_message("🌱 Sampling 25 records from seed dataset")
+
+ assert update is not None
+ assert update.stage == STAGE_SAMPLING
+ assert update.rows == 25
+
+ job = Job(job_id = "job-1")
+ apply_update(job, update)
+ assert job.stage == STAGE_SAMPLING
+ assert job.rows == 25
+
+
+def test_legacy_sampling_log_still_parsed():
+ update = parse_log_message("Preparing samplers to generate 50 records across 3 columns")
+
+ assert update is not None
+ assert update.stage == STAGE_SAMPLING
+ assert update.rows == 50
+ assert update.cols == 3