itstheraj commited on
Commit
944df2c
·
verified ·
1 Parent(s): 09b5221

Update TabArena HF job script

Browse files
Files changed (1) hide show
  1. benchmark/tabarena/hf_job.sh +62 -0
benchmark/tabarena/hf_job.sh ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # FelaTab x TabArena on Hugging Face Jobs (CPU).
3
+ # Launched via huggingface_hub HfApi.run_job (see benchmark/tabarena/launch_hf_job.py).
4
+ # Expects: HF_TOKEN in env (job secret), writes results to dataset repo
5
+ # lowdown-labs/fela-tab-tabarena-results.
6
+ set -euxo pipefail
7
+
8
+ WORK=/workspace
9
+ TABARENA_SUBSET="${TABARENA_SUBSET:-lite}"
10
+ RUN_NAME="${RUN_NAME:-felatab_hfjob}"
11
+
12
+ mkdir -p "$WORK/tmp" && cd "$WORK"
13
+
14
+ pip install -q uv
15
+
16
+ # 1) FelaTab repo (model + this benchmark code) from HF
17
+ python - <<'EOF'
18
+ from huggingface_hub import snapshot_download
19
+ snapshot_download(
20
+ "lowdown-labs/fela-tab",
21
+ allow_patterns=[
22
+ "benchmark/**", "modeling.py", "configuration_felatab.py",
23
+ "config*.json", "model_small_int8.safetensors", "model_big_int8.safetensors",
24
+ ],
25
+ local_dir="/workspace/fela-tab",
26
+ )
27
+ print("fela-tab snapshot ready")
28
+ EOF
29
+
30
+ # 2) TabArena in its own uv venv (Python 3.12 + pre-release AutoGluon)
31
+ git clone --depth 1 https://github.com/autogluon/tabarena.git
32
+ cd tabarena
33
+ uv venv --seed --python 3.12 .venv
34
+ uv pip install --python .venv/bin/python --prerelease=allow -e "./packages/tabarena[benchmark]"
35
+ uv pip install --python .venv/bin/python torch safetensors tabulate "botocore[crt]"
36
+
37
+ # 3) Run FelaTab on TabArena
38
+ cd "$WORK/fela-tab/benchmark/tabarena"
39
+ TMPDIR="$WORK/tmp" AWS_CONFIG_FILE=/dev/null AWS_EC2_METADATA_DISABLED=true \
40
+ "$WORK/tabarena/.venv/bin/python" -u run_tabarena.py \
41
+ --subset "$TABARENA_SUBSET" --run-name "$RUN_NAME" 2>&1 | tee "$WORK/run.log"
42
+
43
+ # 4) Upload results
44
+ python - <<EOF
45
+ from huggingface_hub import HfApi
46
+ api = HfApi()
47
+ api.create_repo("lowdown-labs/fela-tab-tabarena-results", repo_type="dataset", exist_ok=True)
48
+ try:
49
+ api.upload_file(path_or_fileobj="$WORK/run.log", path_in_repo="logs/$RUN_NAME.log",
50
+ repo_id="lowdown-labs/fela-tab-tabarena-results", repo_type="dataset")
51
+ print("uploaded log")
52
+ except Exception as e:
53
+ print("log upload failed", e)
54
+ try:
55
+ api.upload_folder(folder_path="$WORK/fela-tab/benchmark/tabarena/eval/$RUN_NAME",
56
+ path_in_repo="eval/$RUN_NAME",
57
+ repo_id="lowdown-labs/fela-tab-tabarena-results", repo_type="dataset")
58
+ print("uploaded eval")
59
+ except Exception as e:
60
+ print("eval upload failed", e)
61
+ EOF
62
+ echo "JOB_DONE"