Repository navigation
[TUI] a saved preset's lower-case model tag reaches setup as its key (Fix #4209) - #4317
XiaoBinGan wants to merge 1 commit into
Conversation
…p as its key
strata_cli/launch/settings.py saves the model into a preset/choices file lower-case ("--model iq3_xxs"),
and LaunchRunner.setup_args() forwarded it unchanged. setup.py's --model choices are the MODELS table's own
keys ("IQ3_XXS", "Gyro-S"), so argparse refused the argument: starting a saved preset with any choice that
differs from the installed config (--vision, --context, --kv) reran setup and stopped there. Typing the same
name on the command line worked, because cmd.py normalises it through Catalog.resolve().
setup_args() now resolves the pair through the same Catalog.resolve() and keeps the old value when it
cannot. The except is deliberately broad: the resolver reads the model table, and a table that cannot be
read here must not turn a launch that worked into a traceback - the values then go on to setup unchanged,
exactly as before. The new test drives that case with a resolver that raises.
14a1b6f to
2f9f877
Compare
|
A reviewer pass over this changed one thing: the It is now try: # a saved preset or choices file keeps the lower-case tag ("iq3_xxs", #4209), while setup's
fam, model = cat.resolve(str(model), None if fam is None else str(fam)) # --model takes the table's own key
except Exception: # noqa: BLE001 a name the list does not hold, or a list that cannot be read here, is setup's
pass # to report: passing the values on unchanged keeps the launch behaving as it did beforeA third test drives that case with a resolver patched to raise, and asserts the arguments are the preset's own: Re-checked after the change ( Against |
|
Thank you. Your commits are in 0.2.8 with you as the author. Closing this PR because it is now in main. |
Problem and result
Starting a saved preset with any choice that differs from the installed config (
--vision off,--kv,--context) rerunssetup.py, which then stops:Two halves disagree about a model's name.
strata_cli/launch/settings.pywrites the choice into the presetas a lower-case tag (
--model iq3_xxs),LaunchRunner.setup_args()forwards it unchanged, andsetup.py's--modelchoices are theMODELStable's own keys, which are case-sensitive. Typing--model iq3_xxson the command line works, becausecmd.pynormalises it throughCatalog.resolve();the preset path never reaches that.
After this change the preset path uses the same resolver, so
setup_args()carries--model IQ3_XXSand there-run installs instead of stopping.
Related discussion: #4209 — the report, including the setup log line and the two lines it points at.
Approach
Catalog.resolve()is the resolver the command line already uses, so a preset and a typed command nowagree. It also normalises the family when a family-free name is ambiguous.
and its own "did you mean" list. Nothing is refused here that was not refused before.
the neighbours).
Validation
Passed:
py -m pytest tests/terminal/test_launch.py -q(Python 3.11.16, from a source checkout):5 failed, 110 passed, 1 skipped. The five failures are pre-existing on this Windows checkout: with
strata_cli/launch/runner.pyreverted, the same file is 6 failed, 109 passed, 1 skipped — the sixth isthe new test, and it fails with the reported symptom:
Passed: the new cases: a lower-case tag for
qwen(iq3_xxs→IQ3_XXS),coder(iq1_m→IQ1_M),gyro(gyro-s→Gyro-S), a name already in the table's spelling (IQ3_S) and the family the presetcarries; and an unknown name (
not-a-model) still reaching setup unchanged.Failed: none of the new cases.
Not run: a real preset start on Windows as in the report: that needs a model installed on this host and a
GPU the checkout can drive, and the report already shows the failure. I did not repeat the end-to-end start
and am not claiming I did.
Not run:
pytest tests/terminalas a whole: only the file this change touches and its neighbours were run(
test_launch.py), plus the other suites listed in #4314/#4315 work, which do not import this method.Limits
offers still reaches setup, which reports it, as before.
picks rather than the family as saved. That is the same answer the command line gives for the same name.