Download scripts/check-install.py from candypunk/NanoJev-Web: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/candypunk/NanoJev-Web/resolve/main/scripts/check-install.py
- Command line
-
hf download hf://candypunk/NanoJev-Web/scripts/check-install.py
-
curl -L -o check-install.py https://huggingface.co/candypunk/NanoJev-Web/resolve/main/scripts/check-install.py
1.04 kB
| """Check the local runtime without loading a second model.""" | |
| from pathlib import Path | |
| import hashlib,json,platform,subprocess | |
| import torch,transformers,safetensors | |
| ROOT=Path(__file__).resolve().parents[1] | |
| assert platform.system()=='Darwin' and platform.machine()=='arm64','Native Apple Silicon Python required' | |
| assert torch.backends.mps.is_available(),'PyTorch MPS is unavailable' | |
| expected='0a93cfcf7121112fdf90336bda1198ad67a3bb45247da6eedf0dd8672d4d53b5' | |
| h=hashlib.sha256() | |
| with (ROOT/'model/best.safetensors').open('rb') as f: | |
| for block in iter(lambda:f.read(8*1024*1024),b''):h.update(block) | |
| assert h.hexdigest()==expected,'Model checksum mismatch' | |
| browser=subprocess.check_output([str(ROOT/'node_modules/.bin/agent-browser'),'--version'],text=True).strip() | |
| assert browser=='agent-browser 0.37.1',browser | |
| print(json.dumps({'passed':True,'platform':platform.platform(),'torch':torch.__version__,'transformers':transformers.__version__,'safetensors':safetensors.__version__,'agent_browser':browser,'modelSha256':expected},indent=2)) | |