Download code/src/download_published_diff.py from PratikBuilds/modelclinic-experiment-001: direct link, hf CLI and curl.
- Browser
- Download file 971 Bytes
-
https://huggingface.co/datasets/PratikBuilds/modelclinic-experiment-001/resolve/main/code/src/download_published_diff.py
- Command line
-
hf download hf://datasets/PratikBuilds/modelclinic-experiment-001/code/src/download_published_diff.py
-
curl -L -o download_published_diff.py https://huggingface.co/datasets/PratikBuilds/modelclinic-experiment-001/resolve/main/code/src/download_published_diff.py
971 Bytes
| """Fetch the original sparse edit and manifest from the pinned upstream commit.""" | |
| import argparse | |
| import hashlib | |
| from pathlib import Path | |
| import requests | |
| BASE_URL = "https://raw.githubusercontent.com/RikiyaT/lm_understand-logs/4d09ba6d6a7e891dd8063974dfe81b3d78e3494f/exp8_math/runs/p50c/edit" | |
| def main(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--output-dir", type=Path, default=Path("results/checkpoint_analysis")) | |
| args = parser.parse_args() | |
| args.output_dir.mkdir(parents=True, exist_ok=True) | |
| for name in ("edit.npz", "manifest.json"): | |
| response = requests.get(f"{BASE_URL}/{name}", timeout=60) | |
| response.raise_for_status() | |
| path = args.output_dir / ("published_sparse_edit.npz" if name == "edit.npz" else name) | |
| path.write_bytes(response.content) | |
| print(f"saved {path.name}; sha256={hashlib.sha256(response.content).hexdigest()}") | |
| if __name__ == "__main__": | |
| main() | |