zziang commited on
Commit
7cc1272
·
verified ·
1 Parent(s): 7066c31

radio notebook: verify checkpoint length

Browse files
Files changed (1) hide show
  1. kaggle/notebook_radio.py +6 -0
kaggle/notebook_radio.py CHANGED
@@ -15,6 +15,12 @@ def main() -> None:
15
  pull(BUNDLE_REPO, BUNDLE, repo_type="dataset")
16
  if not (BUNDLE / "student4_rc.pt").exists():
17
  raise SystemExit("student4_rc.pt missing from the bundle")
 
 
 
 
 
 
18
  env = dict(os.environ, WORK_ROOT=str(ROOT), CUDA_VISIBLE_DEVICES="0")
19
  rc = subprocess.run([sys.executable, str(BUNDLE / "kaggle/radio_demo.py")],
20
  env=env).returncode
 
15
  pull(BUNDLE_REPO, BUNDLE, repo_type="dataset")
16
  if not (BUNDLE / "student4_rc.pt").exists():
17
  raise SystemExit("student4_rc.pt missing from the bundle")
18
+ # A truncated transfer looks like a present file and fails later inside
19
+ # torch.load, so check the byte count the run recorded.
20
+ expected = 206273737
21
+ got = (BUNDLE / "student4_rc.pt").stat().st_size
22
+ if got != expected:
23
+ raise SystemExit(f"student4_rc.pt is {got} bytes, expected {expected}")
24
  env = dict(os.environ, WORK_ROOT=str(ROOT), CUDA_VISIBLE_DEVICES="0")
25
  rc = subprocess.run([sys.executable, str(BUNDLE / "kaggle/radio_demo.py")],
26
  env=env).returncode