Download paper_export/evidence/code/packaging/create_source_manifest.py from CharlesZhang-USTC/snf_experiments: direct link, hf CLI and curl.
- Browser
- Download file 611 Bytes
-
https://huggingface.co/CharlesZhang-USTC/snf_experiments/resolve/main/paper_export/evidence/code/packaging/create_source_manifest.py
- Command line
-
hf download hf://CharlesZhang-USTC/snf_experiments/paper_export/evidence/code/packaging/create_source_manifest.py
-
curl -L -o create_source_manifest.py https://huggingface.co/CharlesZhang-USTC/snf_experiments/resolve/main/paper_export/evidence/code/packaging/create_source_manifest.py
611 Bytes
| """Hash vendored code without modifying upstream repositories.""" | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| root=Path(__file__).resolve().parents[1] | |
| manifest={} | |
| for path in sorted((root/'vendor').rglob('*')): | |
| if not path.is_file() or any(x in path.parts for x in ('.git','__pycache__','checkpoints','wandb')) or path.suffix.lower() in ('.mp4','.gif','.pyc'):continue | |
| manifest[path.relative_to(root).as_posix()]=hashlib.sha256(path.read_bytes()).hexdigest() | |
| (root/'packaging/sources.manifest.json').write_text(json.dumps(manifest,indent=2)+'\n') | |
| print(f'Hashed {len(manifest)} vendored files') | |