File size: 1,075 Bytes
4167b5c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7cc1272
 
 
 
 
 
4167b5c
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""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()