File size: 971 Bytes
87cc7f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""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()