okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-0243-gui into f-0243-rel (Chat.tsx and DropZone.tsx: the guifix clipboard helpers kept at the conflicts, copyAndTell stays for Markdown and Serving)061a28583

main
1.3 KiB28 linesraw
1"""DeepSeek-V4.1-Flash's model id has dots ("deepseek-v4.1-flash-ist-das-2.00bpw"). The app lists installed models through Control, which
2used to drop any id with a dot: the install finished and the model never appeared."""
3import json
4import tempfile
5import unittest
6from pathlib import Path
7
8from strata_control import models
9
10
11class DotInModelId(unittest.TestCase):
12    def test_ids_with_a_dot_are_accepted_and_odd_ones_are_not(self):
13        for good in ("deepseek-v4.1-flash-ist-das-2.00bpw", "q2_0", "qwen36-ud-q4_k_xl"):
14            self.assertTrue(models.MODEL_ID.fullmatch(good), good)
15        for bad in ("a..b", ".a", "../x", "a/b", "A"):
16            self.assertFalse(models.MODEL_ID.fullmatch(bad), bad)
17
18    def test_a_run_config_with_a_dotted_name_is_listed(self):
19        with tempfile.TemporaryDirectory() as tmp:
20            folder = Path(tmp)
21            (folder / "strata-deepseek-v4.1-flash-ist-das-2.00bpw.json").write_text(json.dumps(
22                {"exe": "/x/strata-dsv41", "tokenizer": str(folder), "args": ["--max-context", "8192"], "model_name": "deepseek-v4.1-flash"}))
23            listed = models.list_installed(str(folder))
24            self.assertEqual([m["id"] for m in listed["models"]], ["deepseek-v4.1-flash-ist-das-2.00bpw"])
25
26
27if __name__ == "__main__":
28    unittest.main()