File size: 2,039 Bytes
2a5f9fb
6a5081f
df66f6e
2a5f9fb
 
6a5081f
 
 
 
 
2a5f9fb
 
 
 
 
0c7ef71
2a5f9fb
 
 
 
 
 
 
0a3530a
63dac32
6a5081f
 
 
 
 
 
 
 
 
 
 
 
 
 
63dac32
6a5081f
2e74c81
6a5081f
 
 
 
395eff6
 
 
0c7ef71
 
2a5f9fb
 
 
 
 
 
 
 
 
df66f6e
2a5f9fb
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
import logging

from huggingface_hub import HfApi

# DEBUG
# Logging the environment variable to debug
hf_home_env = os.getenv("HF_HOME", "Not Set")
print(f"HF_HOME environment variable is set to: {hf_home_env}")

# clone / pull the lmeh eval data
H4_TOKEN = os.environ.get("H4_TOKEN", None)

REPO_ID = "HuggingFaceH4/open_llm_leaderboard"
QUEUE_REPO = "open-llm-leaderboard/requests"
DYNAMIC_INFO_REPO = "open-llm-leaderboard/dynamic_model_information"
RESULTS_REPO = "open-llm-leaderboard/results"

PRIVATE_QUEUE_REPO = "open-llm-leaderboard/private-requests"
PRIVATE_RESULTS_REPO = "open-llm-leaderboard/private-results"

IS_PUBLIC = bool(os.environ.get("IS_PUBLIC", True))

CACHE_PATH = os.getenv("HF_HOME", ".")

# DEBUG STARTS
print(f"Initial CACHE_PATH set to: {CACHE_PATH}")

# Create directory if it doesn't exist and check write permission
if not os.path.isdir(CACHE_PATH):
    try:
        os.makedirs(CACHE_PATH, exist_ok=True)
        print(f"Created directory at: {CACHE_PATH}")
    except PermissionError as e:
        print(f"PermissionError: Unable to create directory at {CACHE_PATH}. {str(e)}")
else:
    print(f"Directory already exists at: {CACHE_PATH}")

# Check write access
if not os.access(CACHE_PATH, os.W_OK):
    print(f"No write access to CACHE_PATH: {CACHE_PATH}. Resetting to current directory.")
    CACHE_PATH = "."
else:
    print(f"Write access confirmed for CACHE_PATH: {CACHE_PATH}")

# DEBUG ENDS 

EVAL_REQUESTS_PATH = os.path.join(CACHE_PATH, "eval-queue")
EVAL_RESULTS_PATH = os.path.join(CACHE_PATH, "eval-results")
DYNAMIC_INFO_PATH = os.path.join(CACHE_PATH, "dynamic-info")
DYNAMIC_INFO_FILE_PATH = os.path.join(DYNAMIC_INFO_PATH, "model_infos.json")

EVAL_REQUESTS_PATH_PRIVATE = "eval-queue-private"
EVAL_RESULTS_PATH_PRIVATE = "eval-results-private"

PATH_TO_COLLECTION = "open-llm-leaderboard/llm-leaderboard-best-models-652d6c7965a4619fb5c27a03"

# Rate limit variables
RATE_LIMIT_PERIOD = 7
RATE_LIMIT_QUOTA = 5
HAS_HIGHER_RATE_LIMIT = ["TheBloke"]

API = HfApi(token=H4_TOKEN)