Launch: no disk warning for model files used where they are, and the tight-fit notice no longer says tight twice

This commit is contained in:
Niko1221 committed 2026-10-31 09:50:48 +01:00
1 parent 3da4517962
commit 27060866eb
2 files changed
+19 -1

No files matched your search

+4 -1
View File
@@ -339,8 +339,11 @@ def apply_defaults(s: S.LaunchSettings, catalog) -> tuple[S.LaunchSettings, list
r = rows[0]
if r.verdict == "no":
notices.append(S.Notice("warn", f"{r.title} does not fit this computer.", "It can still start; expect it to be slow or to run out of memory."))
elif r.verdict == "tight" and s.model_path and "disk space" in r.words:
pass # the files are already here ("used where they are"): there is no download to make room for
elif r.verdict == "tight":
notices.append(S.Notice("warn", f"{r.title} is a tight fit: {r.words}.", "Close other programs before you start."))
words = r.words[len("tight:"):].strip() if r.words.startswith("tight:") else r.words
notices.append(S.Notice("warn", f"{r.title} is a tight fit: {words}.", "Close other programs before you start."))
if s.vision not in (None, "off") and not r.images:
notices.append(S.Notice("warn", f"{r.title} cannot read pictures yet, so pictures are off.", ""))
s.vision = "off"
+15
View File
@@ -457,6 +457,21 @@ class SetupArgs(unittest.TestCase):
s, _ = apply_defaults(S.LaunchSettings(family="qwen", model="IQ3_XXS", vision="off"), cat)
self.assertEqual(s.vision, "off")
def test_a_disk_warning_is_not_shown_for_files_used_where_they_are_and_reads_once(self):
import dataclasses
from strata_cli.launch.cmd import apply_defaults
with Home():
cat = catalog(HW_12)
real = cat.rows()
rows = [dataclasses.replace(r, verdict="tight", words="tight: needs more disk space") for r in real]
with mock.patch.object(type(cat), "rows", lambda self, *a, **k: rows):
_, notes = apply_defaults(S.LaunchSettings(family="qwen", model="IQ3_XXS", model_path="/x"), cat)
self.assertFalse([n for n in notes if "tight" in n.text], notes)
_, notes = apply_defaults(S.LaunchSettings(family="qwen", model="IQ3_XXS"), cat)
text = " ".join(n.text for n in notes)
self.assertIn("is a tight fit: needs more disk space.", text)
self.assertNotIn("tight: tight", text)
def test_the_apps_own_installer_arguments(self):
import tempfile
own = tempfile.mkdtemp()