diff --git a/strata_control/progress_words.py b/strata_control/progress_words.py index d118ee55be..90933d6a02 100644 --- a/strata_control/progress_words.py +++ b/strata_control/progress_words.py @@ -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: diff --git a/tests/terminal/test_progress_words.py b/tests/terminal/test_progress_words.py index 16b1bb8dcf..253968a341 100644 --- a/tests/terminal/test_progress_words.py +++ b/tests/terminal/test_progress_words.py @@ -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")