Datasets:
Download scripts/verify_release.py from XRailgunX/Aemeath-Audio-Dataset: direct link, hf CLI and curl.
- Browser
- Download file 727 Bytes
-
https://huggingface.co/datasets/XRailgunX/Aemeath-Audio-Dataset/resolve/main/scripts/verify_release.py
- Command line
-
hf download hf://datasets/XRailgunX/Aemeath-Audio-Dataset/scripts/verify_release.py
-
curl -L -o verify_release.py https://huggingface.co/datasets/XRailgunX/Aemeath-Audio-Dataset/resolve/main/scripts/verify_release.py
727 Bytes
| """Verify the release's checked file set using the Python standard library.""" | |
| import hashlib | |
| from pathlib import Path | |
| import sys | |
| root = Path(sys.argv[1] if len(sys.argv) > 1 else '.').resolve() | |
| seen = set() | |
| for line in (root / 'SHA256SUMS.txt').read_text(encoding='utf-8').splitlines(): | |
| digest, relative = line.split(' ', 1) | |
| path = (root / relative).resolve() | |
| if root not in path.parents or relative in seen: | |
| raise ValueError('Unsafe or duplicate checksum entry: ' + relative) | |
| seen.add(relative) | |
| if hashlib.sha256(path.read_bytes()).hexdigest() != digest: | |
| raise ValueError('Checksum mismatch: ' + relative) | |
| print('PASS: ' + str(len(seen)) + ' files match SHA256SUMS.txt') | |