Spaces:
Running
Running
File size: 975 Bytes
6ee7257 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import os
from huggingface_hub import HfApi
# Токен для доступа к HuggingFace Hub
H4_TOKEN = os.environ.get("H4_TOKEN", None)
# Репозитории для DeathMath
REPO_ID = "Vikhrmodels/DeathMath-leaderboard"
RESULTS_REPO = "Vikhrmodels/DeathMath-leaderboard-data"
METAINFO_REPO = "Vikhrmodels/DeathMath-leaderboard-metainfo"
# Путь к данным локально
HF_HOME = os.getenv("HF_HOME", ".")
print(f"Initial HF_HOME set to: {HF_HOME}")
# Проверка прав доступа к директории
if not os.access(HF_HOME, os.W_OK):
print(f"No write access to HF_HOME: {HF_HOME}. Resetting to current directory.")
HF_HOME = "."
os.environ["HF_HOME"] = HF_HOME
else:
print("Write access confirmed for HF_HOME")
DATA_PATH = os.path.join(HF_HOME, "data")
# Переменная для обновления лидерборда
RESET_JUDGEMENT_ENV = "RESET_JUDGEMENT"
# API HuggingFace
API = HfApi(token=H4_TOKEN)
|