Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

Download label: the total counts every shard and the picture reader, in the data folder setup is given (--data-dir), not the first shard only

Niko1221594e379291b8
diff --git a/strata_cli/launch/runner.py b/strata_cli/launch/runner.py
index ba20a5eae..f24801ea6 100644
--- a/strata_cli/launch/runner.py
+++ b/strata_cli/launch/runner.py
@@ -624,6 +624,26 @@ class Runner:
"""(title, text) of the question before a download starts, naming exactly what is fetched."""
return self.model_state().question()
+ def progress_job(self) -> dict:
+ """What the download figure is counted over: the folder setup writes the model into (the data folder it is GIVEN, which may be the
+ person's --data-dir and not the default one) and every file of the install with the catalog's total, so a model in several shards
+ shows 'of 66.4 GB' from the start and not the size of the file being fetched."""
+ s, cat = self.s, self.catalog
+ data = Path(s.data_dir) if s.data_dir else (self.existing_data_dir() or cat.data_dir())
+ models_dir = data / "models"
+ job = {"folder": str(models_dir / cat.tag_of(s.family, s.model)),
+ "total_gb": float(next((r.download_gb for r in cat.rows() if r.family == s.family and r.model == s.model), 0) or 0)}
+ try:
+ setup_module = cat.strata.setup_module()
+ if setup_module is not None and not s.model_path:
+ job["files"] = cat.mcp.expected_files(setup_module, str(s.family), str(s.model), models_dir, self.vision_word() != "no")
+ first = next((f for f in job["files"] if f.get("role") == "model"), None)
+ if first: # the folder setup names it (Q2_0), not the lower-case run-config tag (q2_0)
+ job["folder"] = str(Path(first["path"]).parent)
+ except Exception: # noqa: BLE001 - progress is a convenience; the folder scan still counts
+ pass
+ return job
+
def ensure_model(self) -> Path:
s, cat = self.s, self.catalog
self.check_own_files()
@@ -657,8 +677,7 @@ class Runner:
p = self._spawn(argv, env=env, cwd=str(cat.src))
lines: list[str] = []
already: bool | None = None # all the model's files were on disk before this run wrote anything
- folder = str(cat.data_dir() / "models" / cat.tag_of(s.family, s.model))
- total = float(next((r.download_gb for r in cat.rows() if r.family == s.family and r.model == s.model), 0) or 0)
+ job = self.progress_job()
for line in p.stdout: # type: ignore[union-attr]
if self.cancel.is_set():
self._stop_children()
@@ -669,7 +688,7 @@ class Runner:
lines.append(line)
lines[:] = lines[-1500:]
prog = cat.mcp.install_progress(lines)
- prog = cat.mcp.combined_progress(prog, {"folder": folder, "total_gb": total})
+ prog = cat.mcp.combined_progress(prog, job)
dl, phase, label = prog.get("download"), prog.get("phase"), prog.get("label")
if dl and dl.get("total_gb", 0) >= 0.05 and not (s.model_path and phase == "download"):
if phase == "download" and already is None:
diff --git a/tests/terminal/test_flow2_022.py b/tests/terminal/test_flow2_022.py
index 067a2aa38..9e7735653 100644
--- a/tests/terminal/test_flow2_022.py
+++ b/tests/terminal/test_flow2_022.py
@@ -212,5 +212,42 @@ class PlanWords(Base):
+class DownloadTotal(Base):
+ """Finding 4: the figure counts every shard (and the picture reader), in the folder the setup is really given."""
+
+ def run_lines(self, runner: Runner, lines: list[str]) -> list[str]:
+ seen: list[str] = []
+ runner.emit_cb = lambda ev: seen.append(ev.text)
+ proc = mock.Mock()
+ proc.stdout = iter(lines)
+ proc.wait.return_value = 1 # stop after the lines: the failure path is not what is looked at
+ with mock.patch.object(Runner, "_spawn", return_value=proc), mock.patch.object(Runner, "adopt_prepared_files", return_value=None):
+ with self.assertRaises(LaunchError):
+ runner.ensure_model()
+ return seen
+
+ def test_the_total_is_the_whole_model_in_the_chosen_data_folder(self):
+ data = self.base / "mydata"
+ folder = data / "models" / "Q2_0"
+ folder.mkdir(parents=True)
+ first = folder / (Q2[0] + ".part")
+ first.write_bytes(bytes(100_000_000))
+ r = self.runner(family="qwen", model="Q2_0", data_dir=str(data), vision="on", context=32768)
+ job = r.progress_job()
+ self.assertEqual(Path(job["folder"]), folder)
+ self.assertEqual(len(job["files"]), 3) # two shards and the picture reader
+ seen = self.run_lines(r, ["=== Step 5: Getting the model files ===", f"{Q2[0]}: 0.10 / 37.60 GB (0%)"])
+ text = [x for x in seen if "GB" in x]
+ self.assertTrue(text, seen)
+ self.assertIn("of 67.3 GB", text[-1]) # 66.4 GB of shards + 0.9 GB picture reader
+ self.assertNotIn("37.6", " ".join(text))
+
+ def test_the_default_data_folder_is_used_when_none_was_chosen(self):
+ r = self.runner(family="qwen", model="Q2_0", vision="off", context=32768)
+ self.assertEqual(Path(r.progress_job()["folder"]).parts[-2:], ("models", "Q2_0"))
+ self.assertEqual(len(r.progress_job()["files"]), 2)
+
+
+
if __name__ == "__main__":
unittest.main()