webfm-eval / kaggle /notebook_radio.py
zziang's picture
radio notebook: verify checkpoint length
7cc1272 verified
Raw History Blame Contribute Delete
1.08 kB
"""Kaggle notebook body: end-to-end radio segment (LLM script -> Ming speech)."""
import os
import subprocess
import sys
from notebook_eval import BUNDLE, MODEL, ROOT, WEIGHTS, pull, stage_deps, stage_repo
BUNDLE_REPO = "idefinity/webfm-eval"
def main() -> None:
stage_repo()
stage_deps()
pull(WEIGHTS, MODEL)
pull(BUNDLE_REPO, BUNDLE, repo_type="dataset")
if not (BUNDLE / "student4_rc.pt").exists():
raise SystemExit("student4_rc.pt missing from the bundle")
# A truncated transfer looks like a present file and fails later inside
# torch.load, so check the byte count the run recorded.
expected = 206273737
got = (BUNDLE / "student4_rc.pt").stat().st_size
if got != expected:
raise SystemExit(f"student4_rc.pt is {got} bytes, expected {expected}")
env = dict(os.environ, WORK_ROOT=str(ROOT), CUDA_VISIBLE_DEVICES="0")
rc = subprocess.run([sys.executable, str(BUNDLE / "kaggle/radio_demo.py")],
env=env).returncode
print("radio rc", rc)
if __name__ == "__main__":
main()