Download verify_weights.py from pumpkin601/FastRSI-final-weights: direct link, hf CLI and curl.
- Browser
- Download file 642 Bytes
-
https://huggingface.co/pumpkin601/FastRSI-final-weights/resolve/main/verify_weights.py
- Command line
-
hf download hf://pumpkin601/FastRSI-final-weights/verify_weights.py
-
curl -L -o verify_weights.py https://huggingface.co/pumpkin601/FastRSI-final-weights/resolve/main/verify_weights.py
642 Bytes
| """Run inside a downloaded model repository, or pass its directory.""" | |
| import hashlib,json,sys | |
| from pathlib import Path | |
| root=Path(sys.argv[1] if len(sys.argv)>1 else '.') | |
| manifest=json.loads((root/'FINAL_WEIGHT_MANIFEST.json').read_text()) | |
| for row in manifest['files']: | |
| p=root/row['repo_path'];assert p.is_file(),f'Missing: {p}' | |
| assert p.stat().st_size==row['bytes'],f'Size mismatch: {p}' | |
| h=hashlib.sha256() | |
| with p.open('rb') as f: | |
| for block in iter(lambda:f.read(8*1024*1024),b''):h.update(block) | |
| assert h.hexdigest()==row['sha256'],f'Hash mismatch: {p}' | |
| print('OK',row['repo_path']) | |
| print('Verified',len(manifest['files']),'files') | |