File size: 1,305 Bytes
1d31670 9674655 1d31670 |
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 33 34 35 36 37 38 39 40 41 |
import os
from pathlib import Path
from huggingface_hub import HfApi
# Load environment variables from .env file
try:
from dotenv import load_dotenv
# Look for .env file in the project root
env_path = Path(__file__).parent.parent.parent / ".env"
if env_path.exists():
load_dotenv(env_path)
print(f"Loaded .env from: {env_path}")
else:
# Try loading from current directory
load_dotenv()
print("Loaded .env from current directory")
except ImportError:
print("python-dotenv not available, using system environment only")
# Configuration for Icelandic LLM Leaderboard
HF_TOKEN = os.environ.get("HF_TOKEN")
HF_ORGANIZATION = "mideind"
# Debug: Print token status (first 10 chars only for security)
if HF_TOKEN:
print(f"HF_TOKEN loaded: {HF_TOKEN[:10]}...")
else:
print("HF_TOKEN not found in environment")
# Repository configuration
REPO_ID = f"{HF_ORGANIZATION}/icelandic-llm-leaderboard"
QUEUE_REPO = f"{HF_ORGANIZATION}/icelandic-llm-leaderboard-requests"
RESULTS_REPO = f"{HF_ORGANIZATION}/llm-leaderboard-results"
# Local cache paths
HF_HOME = os.getenv("HF_HOME", ".")
EVAL_REQUESTS_PATH = os.path.join(HF_HOME, "eval-queue")
EVAL_RESULTS_PATH = os.path.join(HF_HOME, "eval-results")
# API instance
API = HfApi(token=HF_TOKEN) |