File size: 979 Bytes
9648848 93e54ec 9648848 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Kaggle kernel body for the Phase 4 rehearsal (CPU). `save_notebook` can pass no arguments, so the kernel
# is a pinned wrapper: fetch the rehearsal from the code archive, assert its sha256, then hand over. The
# rehearsal itself pins the five run files it exercises, so this wrapper is the only trust anchor.
import hashlib, os, runpy, subprocess, sys
os.chdir("/kaggle/working")
sys.path.insert(0, "/kaggle/working")
REV = "add04ae7a24bd9925115773a93e870fc1dd01f59"
SHA = "0f7aa77ecc4fa0439c656288085de133fd9110a3e1f9e8ccba0bd8bf21b0888d"
url = f"https://huggingface.co/Cion-lab/ounce100m-code/resolve/{REV}/kernels/phase4_prep.py"
assert subprocess.run(["curl", "-sfL", url, "-o", "phase4_prep.py"]).returncode == 0, "fetch prep"
got = hashlib.sha256(open("phase4_prep.py", "rb").read()).hexdigest()
assert got == SHA, ("PREP SHA MISMATCH", got[:16], SHA[:16])
print("PREP_BOOTSTRAP_OK", REV[:12], got[:12], flush=True)
runpy.run_path("phase4_prep.py", run_name="__main__")
|