okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
0f1e5e4cb
main
1"""The release gate for a feed model's install, as a test in `python tools/check` (py-tools): a REAL synthetic GGUF installed through setup.py from a signed 2test feed (throw-away key) and a local Hugging Face stand-in. See tools/feed_model_install_gate.py for what it does and checks; it catches the Q4-P8 rehearsal's 3F2 (KeyError 'mmproj'), F3 (the Flash-Next draft layer fetched for `drafter: none`), F4 (the shipped expert profile of another shape) and F5 (no RAM budget, a 4second copy of the experts). 5 6python -m pytest tools/test_feed_model_install_realfile.py 7 8Needs numpy (no llama.cpp checkout and no STRATA_TEST_LLAMA_CPP any more: the preparation tools use tools/strata_gguf.py, not gguf-py); without it the test is SKIPPED 9with that reason, which `tools/check` prints. The engine step (one request) is the gate script's own --engine option and needs a box with an engine built for the file's shape. 10""" 11from __future__import annotations 12 13import shutil 14import sys 15import tempfile 16import unittest 17from pathlib import Path 18 19ROOT = Path (__file__ ).resolve ().parents [1 ] 20sys .path .insert (0 ,str (ROOT / "tools" )) 21 22import feed_model_install_gate as gate # noqa: E402 23 24 25class FeedModelInstallFromRealFile (unittest .TestCase ): 26def test_a_small_synthetic_model_installs_through_setup (self ): 27try : 28gate .check_gguf_tools () 29import numpy # noqa: F401 30except gate .NotRun as e : 31self .skipTest (str (e )) 32except ImportError : 33self .skipTest ("numpy is not installed (tools/q4geo_synth.py needs it)" ) 34work = Path (tempfile .mkdtemp (prefix = "strata-feed-install-" )) 35self .addCleanup (shutil .rmtree ,work ,True ) 36try : 37res = gate .check (work ,None ,gate .TINY ,lambda s :None ) 38except gate .NotRun as e : 39self .skipTest (str (e )) 40self .assertEqual (res ["problems" ], [],"\n" .join (res ["out" ].splitlines ()[- 30 :])) 41 42 43if __name__ == "__main__" : 44unittest .main ()