Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/MojoLlama/blob/main/test_metadata.py # MojoLlama Archived Mojo/MAX quantizer and serving research repository (read-only history) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `MojoLlama / test_metadata.py` 31 lines ยท 1104 bytes Raw Blame History 1 #!/usr/bin/env python3 2 """Test _read_gguf_metadata on available GGUF models.""" 3 import sys 4 sys.path.insert(0, '/onedev-workspace/work/src') 5 from mojollama.quantizer import _read_gguf_metadata 6 import os 7 8 models_dir = '/onedev-workspace/work' 9 found = 0 10 for f in sorted(os.listdir(models_dir)): 11 if f.endswith('.gguf'): 12 path = os.path.join(models_dir, f) 13 try: 14 meta = _read_gguf_metadata(path) 15 arch = meta.get('architecture', '?') 16 params = meta.get('n_params_hr', '?') 17 ctx = meta.get('context_length', '?') 18 blk = meta.get('block_count', '?') 19 quant = meta.get('quant_type', '?') 20 prefixes_used = meta.get('_prefixes_used', []) 21 print(f' {f}:') 22 print(f' arch={arch}, params={params}, ctx={ctx}, layers={blk}, quant={quant}') 23 print(f' prefixes={prefixes_used}') 24 found += 1 25 except Exception as e: 26 print(f' {f}: ERROR - {e}') 27 28 if found == 0: 29 print(' No .gguf models found') 30 else: 31 print(f'\n Read {found} models successfully')