Spaces:
Sleeping
Sleeping
Download scripts/verify_release.py from HirModel/little-wren: direct link, hf CLI and curl.
- Browser
- Download file 685 Bytes
-
https://huggingface.co/spaces/HirModel/little-wren/resolve/main/scripts/verify_release.py
- Command line
-
hf download hf://spaces/HirModel/little-wren/scripts/verify_release.py
-
curl -L -o verify_release.py https://huggingface.co/spaces/HirModel/little-wren/resolve/main/scripts/verify_release.py
685 Bytes
| #!/usr/bin/env python3 | |
| """Verify recorded release bytes. Hash agreement is not source authentication.""" | |
| import hashlib,json,sys | |
| from pathlib import Path | |
| R=Path(__file__).resolve().parents[1] | |
| def main(): | |
| m=json.loads((R/'MANIFEST.json').read_text());bad=[] | |
| for name,expected in m['files'].items(): | |
| p=R/name | |
| if not p.is_file() or hashlib.sha256(p.read_bytes()).hexdigest()!=expected:bad.append(name) | |
| print(json.dumps({'status':'RELEASE_BYTES_MATCH' if not bad else 'MISMATCH','files_checked':len(m['files']),'failed':bad,'boundary':'Byte comparison only. Review external SHA-256 custody separately.'},indent=2)) | |
| return bool(bad) | |
| if __name__=='__main__':raise SystemExit(main()) | |