Spaces:
Running
Running
hi-melnikov
commited on
Commit
•
455e9dc
1
Parent(s):
381feac
Add tokens
Browse files- src/envs.py +1 -0
- src/gen/show_result.py +4 -0
- src/leaderboard/build_leaderboard.py +2 -2
src/envs.py
CHANGED
@@ -16,6 +16,7 @@ PRIVATE_RESULTS_REPO = "open-llm-leaderboard/private-results"
|
|
16 |
IS_PUBLIC = bool(os.environ.get("IS_PUBLIC", True))
|
17 |
|
18 |
HF_HOME = os.getenv("HF_HOME", ".")
|
|
|
19 |
|
20 |
# Check HF_HOME write access
|
21 |
print(f"Initial HF_HOME set to: {HF_HOME}")
|
|
|
16 |
IS_PUBLIC = bool(os.environ.get("IS_PUBLIC", True))
|
17 |
|
18 |
HF_HOME = os.getenv("HF_HOME", ".")
|
19 |
+
HF_TOKEN_PRIVATE = os.environ.get("HF_TOKEN_PRIVATE")
|
20 |
|
21 |
# Check HF_HOME write access
|
22 |
print(f"Initial HF_HOME set to: {HF_HOME}")
|
src/gen/show_result.py
CHANGED
@@ -12,6 +12,8 @@ from sklearn.linear_model import LogisticRegression
|
|
12 |
from tqdm import tqdm
|
13 |
from utils import load_model_answers
|
14 |
|
|
|
|
|
15 |
|
16 |
def compute_mle_elo(df, SCALE=400, BASE=10, INIT_RATING=1000):
|
17 |
models = pd.concat([df["model_a"], df["model_b"]]).unique()
|
@@ -265,6 +267,7 @@ if __name__ == "__main__":
|
|
265 |
path_in_repo="leaderboard.json",
|
266 |
repo_id="Vikhrmodels/arena-leaderboard-metainfo",
|
267 |
repo_type="space",
|
|
|
268 |
)
|
269 |
|
270 |
huggingface_hub.HfApi().upload_file(
|
@@ -272,4 +275,5 @@ if __name__ == "__main__":
|
|
272 |
path_in_repo=f"leaderboard_logs/{json_file_name}",
|
273 |
repo_id="Vikhrmodels/arena-leaderboard-metainfo",
|
274 |
repo_type="dataset",
|
|
|
275 |
)
|
|
|
12 |
from tqdm import tqdm
|
13 |
from utils import load_model_answers
|
14 |
|
15 |
+
from src.envs import HF_TOKEN_PRIVATE
|
16 |
+
|
17 |
|
18 |
def compute_mle_elo(df, SCALE=400, BASE=10, INIT_RATING=1000):
|
19 |
models = pd.concat([df["model_a"], df["model_b"]]).unique()
|
|
|
267 |
path_in_repo="leaderboard.json",
|
268 |
repo_id="Vikhrmodels/arena-leaderboard-metainfo",
|
269 |
repo_type="space",
|
270 |
+
token=HF_TOKEN_PRIVATE,
|
271 |
)
|
272 |
|
273 |
huggingface_hub.HfApi().upload_file(
|
|
|
275 |
path_in_repo=f"leaderboard_logs/{json_file_name}",
|
276 |
repo_id="Vikhrmodels/arena-leaderboard-metainfo",
|
277 |
repo_type="dataset",
|
278 |
+
token=HF_TOKEN_PRIVATE,
|
279 |
)
|
src/leaderboard/build_leaderboard.py
CHANGED
@@ -6,7 +6,7 @@ import time
|
|
6 |
import pandas as pd
|
7 |
from huggingface_hub import snapshot_download
|
8 |
|
9 |
-
from src.envs import DATA_ARENA_PATH, DATA_PATH
|
10 |
|
11 |
# Configure logging
|
12 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
@@ -37,7 +37,7 @@ def download_dataset(repo_id, local_dir, repo_type="dataset", max_attempts=3, ba
|
|
37 |
local_dir=local_dir,
|
38 |
repo_type=repo_type,
|
39 |
tqdm_class=None,
|
40 |
-
token=
|
41 |
etag_timeout=30,
|
42 |
max_workers=8,
|
43 |
)
|
|
|
6 |
import pandas as pd
|
7 |
from huggingface_hub import snapshot_download
|
8 |
|
9 |
+
from src.envs import DATA_ARENA_PATH, DATA_PATH, HF_TOKEN_PRIVATE
|
10 |
|
11 |
# Configure logging
|
12 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
|
|
37 |
local_dir=local_dir,
|
38 |
repo_type=repo_type,
|
39 |
tqdm_class=None,
|
40 |
+
token=HF_TOKEN_PRIVATE,
|
41 |
etag_timeout=30,
|
42 |
max_workers=8,
|
43 |
)
|