Download hyperparameter/c2/tabddpm/tabddpm-c2-20260504_181749/_tabddpm_train.py from TabQueryBench2026/server: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/datasets/TabQueryBench2026/server/resolve/main/hyperparameter/c2/tabddpm/tabddpm-c2-20260504_181749/_tabddpm_train.py
- Command line
-
hf download hf://datasets/TabQueryBench2026/server/hyperparameter/c2/tabddpm/tabddpm-c2-20260504_181749/_tabddpm_train.py
-
curl -L -o _tabddpm_train.py https://huggingface.co/datasets/TabQueryBench2026/server/resolve/main/hyperparameter/c2/tabddpm/tabddpm-c2-20260504_181749/_tabddpm_train.py
1.38 kB
| import os, sys, subprocess | |
| tabddpm_root = "/workspace/tabddpm/code" | |
| assert os.path.isdir(tabddpm_root), f"TabDDPM source not mounted: {tabddpm_root}" | |
| env = os.environ.copy() | |
| env["PYTHONPATH"] = tabddpm_root + (os.pathsep + env.get("PYTHONPATH", "")) | |
| # Write a wrapper that patches collections.Sequence (removed in Python 3.10+) | |
| # before running pipeline.py - needed because skorch uses old API | |
| wrapper = os.path.join(tabddpm_root, "_compat_run.py") | |
| with open(wrapper, "w") as f: | |
| f.write( | |
| "import collections, collections.abc\n" | |
| "for _a in ('Sequence','MutableSequence','MutableMapping','Mapping'," | |
| "'MutableSet','Set','Callable','Iterable','Iterator'):\n" | |
| " if not hasattr(collections, _a): setattr(collections, _a, getattr(collections.abc, _a, None))\n" | |
| "import sys, runpy\n" | |
| "sys.argv = sys.argv[1:]\n" | |
| "runpy.run_path(sys.argv[0], run_name='__main__')\n" | |
| ) | |
| print(f"[TabDDPM] Training, config=/work/output-Benchmark-trainonly-v1/c2/tabddpm/tabddpm-c2-20260504_181749/config.toml") | |
| ret = subprocess.run( | |
| [sys.executable, wrapper, "scripts/pipeline.py", | |
| "--config", "/work/output-Benchmark-trainonly-v1/c2/tabddpm/tabddpm-c2-20260504_181749/config.toml", | |
| "--train"], | |
| cwd=tabddpm_root, | |
| env=env | |
| ) | |
| if ret.returncode != 0: | |
| sys.exit(ret.returncode) | |
| print("[TabDDPM] Training complete") | |