import os from huggingface_hub import HfApi # Space this app runs as. Spaces sets SPACE_ID in the container, so the same # code can live in kaz-llm-lb and kaz-llm-lb2 without either one restarting # the other. The fallback only applies when running outside a Space. REPO_ID = os.environ.get("SPACE_ID") or "kz-transformers/kaz-llm-lb2" # Datasets holding the leaderboard state and the per-model submissions. # Both are private; reads and writes need a token with access to the org. METAINFO_REPO = "kz-transformers/kaz-llm-lb-metainfo" SUBMISSIONS_REPO = "kz-transformers/s-openbench-eval" # Space secret. Set in Settings -> Variables and secrets, never committed. HF_TOKEN_PRIVATE = os.environ.get("H4_TOKEN") HF_HOME = os.getenv("HF_HOME", ".") if not os.access(HF_HOME, os.W_OK): HF_HOME = "." os.environ["HF_HOME"] = HF_HOME DATA_PATH = os.path.join(HF_HOME, "data") SUBMISSIONS_PATH = "m_data" API = HfApi(token=HF_TOKEN_PRIVATE)