Spaces:
Running
Running
| """Preflight checks for the preferred Nemotron GGUF runtime assets. | |
| This script only lists Hugging Face repository metadata. It does not download | |
| model weights and it does not prove image input works in llama.cpp. | |
| """ | |
| from __future__ import annotations | |
| import os | |
| import sys | |
| from huggingface_hub import HfApi | |
| MODEL_REPO = os.getenv( | |
| "SNAP2SIM_MODEL_REPO", | |
| "unsloth/NVIDIA-Nemotron-3-Nano-Omni-30B-A3B-Reasoning-GGUF", | |
| ) | |
| GGUF_QUANT = os.getenv("SNAP2SIM_GGUF_QUANT", "UD-Q4_K_M") | |
| MMPROJ_FILE = os.getenv("SNAP2SIM_MMPROJ_FILE", "mmproj-F16.gguf") | |
| def main() -> int: | |
| files = HfApi().list_repo_files(MODEL_REPO) | |
| quant_matches = [name for name in files if name.endswith(".gguf") and GGUF_QUANT in name] | |
| mmproj_matches = [name for name in files if name.startswith("mmproj") and name.endswith(".gguf")] | |
| print(f"repo: {MODEL_REPO}") | |
| print(f"quant selector: {GGUF_QUANT}") | |
| print(f"quant files: {', '.join(quant_matches) or 'NONE'}") | |
| print(f"mmproj files: {', '.join(mmproj_matches) or 'NONE'}") | |
| print(f"selected mmproj: {MMPROJ_FILE}") | |
| missing = [] | |
| if not quant_matches: | |
| missing.append(f"GGUF quant containing {GGUF_QUANT}") | |
| if MMPROJ_FILE not in files: | |
| missing.append(MMPROJ_FILE) | |
| if missing: | |
| print(f"missing: {', '.join(missing)}", file=sys.stderr) | |
| return 1 | |
| print("preflight: PASS") | |
| print( | |
| "next: run a GPU smoke test with llama.cpp using the selected GGUF and " | |
| "mmproj, then send one image prompt through the server." | |
| ) | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |