Download code/scripts/run_oven_label_study.py from lsnu/VLAdaptorBench: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/lsnu/VLAdaptorBench/resolve/cd265468967fd6bb40591e7532e98dcdc4e2baec/code/scripts/run_oven_label_study.py
- Command line
-
hf download hf://lsnu/VLAdaptorBench@cd265468967fd6bb40591e7532e98dcdc4e2baec/code/scripts/run_oven_label_study.py
-
curl -L -o run_oven_label_study.py https://huggingface.co/lsnu/VLAdaptorBench/resolve/cd265468967fd6bb40591e7532e98dcdc4e2baec/code/scripts/run_oven_label_study.py
1.21 kB
| import os | |
| from pathlib import Path | |
| import sys | |
| PROJECT_ROOT = Path(__file__).resolve().parents[1] | |
| if str(PROJECT_ROOT) not in sys.path: | |
| sys.path.insert(0, str(PROJECT_ROOT)) | |
| def _configure_thread_env() -> None: | |
| # Keep BLAS/OpenMP libraries from spawning machine-wide thread pools per worker. | |
| defaults = { | |
| "OMP_NUM_THREADS": "1", | |
| "OPENBLAS_NUM_THREADS": "1", | |
| "MKL_NUM_THREADS": "1", | |
| "NUMEXPR_NUM_THREADS": "1", | |
| "VECLIB_MAXIMUM_THREADS": "1", | |
| "BLIS_NUM_THREADS": "1", | |
| } | |
| for key, value in defaults.items(): | |
| os.environ.setdefault(key, value) | |
| def _configure_coppeliasim_env() -> None: | |
| coppeliasim_root = os.environ.setdefault("COPPELIASIM_ROOT", "/workspace/coppelia_sim") | |
| ld_library_path_parts = [ | |
| part for part in os.environ.get("LD_LIBRARY_PATH", "").split(":") if part | |
| ] | |
| if coppeliasim_root not in ld_library_path_parts: | |
| ld_library_path_parts.insert(0, coppeliasim_root) | |
| os.environ["LD_LIBRARY_PATH"] = ":".join(ld_library_path_parts) | |
| _configure_thread_env() | |
| _configure_coppeliasim_env() | |
| from rr_label_study.oven_study import main | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |