Download verify.py from atmem/stateful-memory-database-10pct-v2: direct link, hf CLI and curl.
- Browser
- Download file 487 Bytes
-
https://huggingface.co/datasets/atmem/stateful-memory-database-10pct-v2/resolve/main/verify.py
- Command line
-
hf download hf://datasets/atmem/stateful-memory-database-10pct-v2/verify.py
-
curl -L -o verify.py https://huggingface.co/datasets/atmem/stateful-memory-database-10pct-v2/resolve/main/verify.py
487 Bytes
| from pathlib import Path | |
| import hashlib, json, sqlite3 | |
| root=Path(__file__).parent | |
| m=json.loads((root/'publication-manifest.json').read_text()) | |
| for item in m['inventory']: | |
| p=root/item['path']; h='sha256:'+hashlib.sha256(p.read_bytes()).hexdigest() | |
| assert h==item['sha256'], (item['path'], h) | |
| if p.suffix=='.sqlite3': | |
| c=sqlite3.connect(f'file:{p}?mode=ro&immutable=1', uri=True); assert c.execute('PRAGMA quick_check').fetchone()[0]=='ok'; c.close() | |
| print('ok', m['manifest_digest']) | |