progress words: "Preparing the draft layer" only when the draft-layer step runs

Setup's step 6 ends the model preparation with "[ok] model prepared";
the launch's progress line read that marker as the draft layer's
preparation, so every launch showed "Preparing the draft layer", also
with Drafting Off, with DFlash2 and offline, where no draft layer is
touched (0.2.14: l620 offline / Off / Auto, Boston; free disk
unchanged). That marker now gives the existing model-preparation words
("Preparing your model for Strata (one time)"); the draft layer's own
lines (mtp_fetch.py, mtp_pack.py, mtp_rt.py, "[ok] MTP draft layer")
keep theirs. No new text.

Test: tests/terminal/test_progress_words.py (step 6 after "[ok] model
prepared" alone, after the Off line and after the DFlash2 line).
This commit is contained in:
Niko1221 committed 2026-11-15 19:16:47 +01:00
1 parent 3dcdb99a71
commit 51543fd4bc
2 files changed
+11 -1

No files matched your search

+3 -1
View File
@@ -100,8 +100,10 @@ def describe(step: int | None, lines: list[str], download: dict | None = None) -
return Words("draft", "Preparing the draft layer")
if "mtp_fetch.py" in low or "mtp draft layer:" in low or "of mtp tensors" in low:
return Words("draft_download", "Downloading the draft layer (about 5 GB; it makes answers about twice as fast)")
if "mtp_rt.py" in low or "mtp_pack.py" in low or "[ok] model prepared" in low:
if "mtp_rt.py" in low or "mtp_pack.py" in low:
return Words("draft", "Preparing the draft layer")
if "[ok] model prepared" in low: # the model is prepared and no draft-layer step ran after it (Off, DFlash2, offline, the layer already here
return Words("pack", "Preparing your model for Strata (one time)") # says "[ok] MTP draft layer" above): the model-preparation words, not the draft layer's
if "strata_pack.py" in low or "converting the q2_0 experts" in low:
return Words("pack", "Packing the model's experts for your processor (one time, a few minutes)")
if "pack_index.py" in low:
+8
View File
@@ -100,6 +100,14 @@ class StepWords(unittest.TestCase):
p, label, phase = prog(HEAD + STEP5 + STEP6 + fetch + [" > python tools/mtp_rt.py --gguf g --out rt"])
self.assertEqual(phase, "draft")
def test_step_six_without_a_draft_layer_step_is_not_the_draft_layer(self):
# 0.2.14 (l620 offline / Off / Auto, Boston): every launch showed "Preparing the draft layer" after "[ok] model prepared", with no draft layer touched
for after in ([], [" [ok] the draft layer (MTP) is off: its ~5 GB are not downloaded (`--mtp on` fetches it later)"],
[" [ok] DFlash2 is the drafter: the MTP draft layer's ~5 GB are not downloaded (choosing the MTP later fetches it once)"]):
with self.subTest(after=after):
p, label, phase = prog(HEAD + STEP5 + STEP6 + [" [ok] model prepared: y", *after])
self.assertEqual((label, phase), ("Preparing your model for Strata (one time)", "pack"))
def test_step_six_with_everything_already_there(self):
lines = HEAD + STEP5 + STEP6 + [" [ok] model prepared: y", " [ok] MTP draft layer: z"]
self.assertEqual(prog(lines)[2], "draft")