Download verify_handoff.py from chenruishuo/roll-data: direct link, hf CLI and curl.
- Browser
- Download file 831 Bytes
-
https://huggingface.co/datasets/chenruishuo/roll-data/resolve/main/verify_handoff.py
- Command line
-
hf download hf://datasets/chenruishuo/roll-data/verify_handoff.py
-
curl -L -o verify_handoff.py https://huggingface.co/datasets/chenruishuo/roll-data/resolve/main/verify_handoff.py
831 Bytes
| """Verify the downloaded handoff without extra packages.""" | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| root = Path(__file__).resolve().parent | |
| manifest = json.loads((root / 'FILES_SHA256.json').read_text()) | |
| for relative, info in manifest.items(): | |
| path = root / relative | |
| if not path.resolve().is_relative_to(root): | |
| raise SystemExit('Unsafe manifest path: ' + relative) | |
| if not path.is_file() or path.stat().st_size != info['bytes']: | |
| raise SystemExit('Missing or wrong size: ' + relative) | |
| with path.open('rb') as stream: | |
| actual = hashlib.file_digest(stream, 'sha256').hexdigest() | |
| if actual != info['sha256']: | |
| raise SystemExit('SHA256 mismatch: ' + relative) | |
| print(f'PASS: {len(manifest)} files verified; this is a compact results package, not full trajectories or media.') | |