Spaces:
Running on Zero
Running on Zero
Download src/envs.py from primenumbersam/arena: direct link, hf CLI and curl.
- Browser
- Download file 571 Bytes
-
https://huggingface.co/spaces/primenumbersam/arena/resolve/main/src/envs.py
- Command line
-
hf download hf://spaces/primenumbersam/arena/src/envs.py
-
curl -L -o envs.py https://huggingface.co/spaces/primenumbersam/arena/resolve/main/src/envs.py
571 Bytes
| import os | |
| from pathlib import Path | |
| from huggingface_hub import HfApi | |
| TOKEN = os.environ.get("HF_TOKEN") | |
| # HF Space Storage Bucket mount path (/data) and bucket settings | |
| STORAGE_DIR = Path(os.getenv("ARENA_STORAGE_DIR", "/data")) | |
| BUCKET_NAME = os.getenv("HF_BUCKET_NAME", "arena-storage") | |
| BUCKET_ID = os.getenv("HF_BUCKET_ID", "") | |
| DB_FILENAME = "market.db" | |
| ROOT_DIR = Path(__file__).resolve().parent.parent | |
| LOCAL_FALLBACK_DB = ROOT_DIR / "data" / DB_FILENAME | |
| CACHE_DB_PATH = Path(os.getenv("HF_HOME", str(ROOT_DIR / ".cache"))) / DB_FILENAME | |
| API = HfApi(token=TOKEN) | |