zziang commited on
Commit
c2264fc
·
verified ·
1 Parent(s): e888931

browser export: lm/aggregator/voc with validation + int4

Browse files
Files changed (1) hide show
  1. kaggle/notebook_export.py +25 -0
kaggle/notebook_export.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Kaggle notebook body: export the browser graphs (lm, aggregator, voc)."""
2
+ import os
3
+ import subprocess
4
+ import sys
5
+
6
+ from notebook_eval import BUNDLE, MODEL, ROOT, WEIGHTS, pull, stage_deps, stage_repo
7
+
8
+ BUNDLE_REPO = "idefinity/webfm-eval"
9
+
10
+
11
+ def main() -> None:
12
+ stage_repo()
13
+ stage_deps()
14
+ subprocess.run("pip install -q onnx_ir onnxscript", shell=True, check=False)
15
+ pull(WEIGHTS, MODEL)
16
+ pull(BUNDLE_REPO, BUNDLE, repo_type="dataset")
17
+ env = dict(os.environ, WORK_ROOT=str(ROOT), CUDA_VISIBLE_DEVICES="0",
18
+ STAGE=os.environ.get("STAGE", "all"))
19
+ rc = subprocess.run([sys.executable, str(BUNDLE / "kaggle/export_browser.py")],
20
+ env=env).returncode
21
+ print("export rc", rc)
22
+
23
+
24
+ if __name__ == "__main__":
25
+ main()