Turbo-Kev-Dictate-1.4B / code /scripts /verify_bundles.py
Lucasgitguy-co's picture
Turbo-Kev Dictate release
20149a3 verified
Raw History Blame Contribute Delete
1.32 kB
import hashlib, json, os, subprocess, sys, shutil, warnings
warnings.filterwarnings("ignore")
from huggingface_hub import HfApi
a = HfApi()
jobs = {
"lfm3-vl-2b-heretic-Q4_K_M-mmproj-bundle.gguf": ("Lucasgitguy-co/lfm3-vl-2b-heretic-gguf", ""),
"minicpm-mermaid-Q4_K_M-mmproj-bundle.gguf": ("Lucasgitguy-co/minicpm-mermaid-gguf", ""),
"minicpm-mermaid-heretic-Q4_K_M-mmproj-bundle.gguf": ("Lucasgitguy-co/minicpm-mermaid-heretic-gguf", ""),
"minicpm-mermaid-heretic-trial65-Q4_K_M-mmproj-bundle.gguf": ("Lucasgitguy-co/minicpm-mermaid-heretic-trial65-gguf", ""),
"spot-snake-d1-2B-v0.1-Q4_K_M-mmproj-bundle.gguf": ("Lucasgitguy-co/spot-snake-d1-2B-v0.1", "gguf/"),
}
bad = 0
for b, (repo, pre) in jobs.items():
hub = {s.rfilename: s.lfs.sha256 for s in a.model_info(repo, files_metadata=True).siblings if s.lfs}
d = "work/unpack-test"; shutil.rmtree(d, ignore_errors=True)
subprocess.run([sys.executable, "scripts/gguf_bundle.py", "unpack", "out/bundles/" + b, "-o", d], check=True, capture_output=True)
for f in os.listdir(d):
h = hashlib.sha256(open(os.path.join(d, f), "rb").read()).hexdigest()
ok = hub.get(pre + f) == h
bad += not ok
print("OK " if ok else "BAD", b, "->", f, h[:16])
shutil.rmtree(d)
print("ALL_MATCH" if not bad else "MISMATCHES %d" % bad)