okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
8a66da38a
main
1"""strata-vision opens a GGUF with tensor types llama.cpp does not know (Gyro's TQK6 / TQK7), for its vocabulary only. 2 3The check is a C++ program (tools/vision/gguf_meta_test.cpp, CMake target strata-vision-gguf-test) built with the encoder. 4Set STRATA_VISION_GGUF_TEST to the built binary to run it here; without it the test is skipped (no compiler needed). 5""" 6 7import os 8import subprocess 9import tempfile 10import unittest 11from pathlib import Path 12 13 14class VisionGgufMetaTest (unittest .TestCase ): 15def test_unknown_tensor_types_do_not_stop_the_vocabulary_load (self ): 16binary = os .environ .get ("STRATA_VISION_GGUF_TEST" ,"" ) 17if not binary or not Path (binary ).is_file (): 18self .skipTest ("STRATA_VISION_GGUF_TEST is not set (build the strata-vision-gguf-test target)" ) 19with tempfile .TemporaryDirectory ()as folder : 20done = subprocess .run ([binary ,folder ],capture_output = True ,text = True ,timeout = 120 ) 21self .assertEqual (done .returncode ,0 ,done .stdout + done .stderr ) 22self .assertIn ("GGUF-META PASS" ,done .stdout ) 23 24def test_the_gyro_sizes_read_pictures (self ): 25import setup 26for model in ("Gyro-S" ,"Gyro-M" ): 27self .assertIs (setup .MODELS [model ].get ("vision" ),True ) 28self .assertIs (setup .FAMILIES ["gyro" ].get ("vision" ),True ) 29 30 31if __name__ == "__main__" : 32unittest .main ()