Spaces:
Starting
Starting
fix
Browse files- app.py +8 -3
- data/leaderboard.json +1 -1
- m_data/model_data/external/saiga_3_8bapsys.json +1 -1
- src/envs.py +1 -1
- src/leaderboard/build_leaderboard.py +3 -1
app.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
import logging
|
2 |
import os
|
|
|
|
|
3 |
import subprocess
|
4 |
|
5 |
import gradio as gr
|
@@ -22,7 +24,7 @@ from src.display.utils import (
|
|
22 |
from src.envs import API, H4_TOKEN, HF_HOME, REPO_ID, RESET_JUDGEMENT_ENV
|
23 |
from src.leaderboard.build_leaderboard import build_leadearboard_df, download_openbench, download_dataset
|
24 |
import huggingface_hub
|
25 |
-
huggingface_hub.login(token=H4_TOKEN)
|
26 |
|
27 |
os.environ["GRADIO_ANALYTICS_ENABLED"] = "false"
|
28 |
|
@@ -126,16 +128,19 @@ def update_board():
|
|
126 |
os.environ[RESET_JUDGEMENT_ENV] = "0"
|
127 |
import shutil
|
128 |
shutil.rmtree("m_data")
|
|
|
129 |
download_dataset("Vikhrmodels/s-openbench-eval", "m_data")
|
130 |
import glob
|
131 |
-
data_list = []
|
132 |
-
for file in glob.glob("m_data/model_data/external/*.json"):
|
133 |
with open(file) as f:
|
134 |
try:
|
135 |
data = json.load(f)
|
136 |
data_list.append(data)
|
137 |
except:
|
138 |
continue
|
|
|
|
|
139 |
with open("genned.json", "w") as f:
|
140 |
json.dump(data_list, f)
|
141 |
|
|
|
1 |
import logging
|
2 |
import os
|
3 |
+
os.makedirs("tmp", exist_ok=True)
|
4 |
+
os.environ['TMP_DIR'] = "tmp"
|
5 |
import subprocess
|
6 |
|
7 |
import gradio as gr
|
|
|
24 |
from src.envs import API, H4_TOKEN, HF_HOME, REPO_ID, RESET_JUDGEMENT_ENV
|
25 |
from src.leaderboard.build_leaderboard import build_leadearboard_df, download_openbench, download_dataset
|
26 |
import huggingface_hub
|
27 |
+
# huggingface_hub.login(token=H4_TOKEN)
|
28 |
|
29 |
os.environ["GRADIO_ANALYTICS_ENABLED"] = "false"
|
30 |
|
|
|
128 |
os.environ[RESET_JUDGEMENT_ENV] = "0"
|
129 |
import shutil
|
130 |
shutil.rmtree("m_data")
|
131 |
+
shutil.rmtree("data")
|
132 |
download_dataset("Vikhrmodels/s-openbench-eval", "m_data")
|
133 |
import glob
|
134 |
+
data_list = [{"musicmc": 0.3021276595744681, "lawmc": 0.2800829875518672, "model": "apsys/saiga_3_8b", "moviesmc": 0.3472222222222222, "booksmc": 0.2800829875518672, "model_dtype": "torch.float16", "ppl": 0}]
|
135 |
+
for file in glob.glob("./m_data/model_data/external/*.json"):
|
136 |
with open(file) as f:
|
137 |
try:
|
138 |
data = json.load(f)
|
139 |
data_list.append(data)
|
140 |
except:
|
141 |
continue
|
142 |
+
if len(data_list) >=1:
|
143 |
+
data_list.pop(0)
|
144 |
with open("genned.json", "w") as f:
|
145 |
json.dump(data_list, f)
|
146 |
|
data/leaderboard.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
[
|
|
|
1 |
+
[]
|
m_data/model_data/external/saiga_3_8bapsys.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"musicmc": 0.
|
|
|
1 |
+
{"musicmc": 0.2936170212765957, "lawmc": 0.48094747682801237, "model": "apsys/saiga_3_8b", "moviesmc": 0.3402777777777778, "booksmc": 0.3112033195020747, "model_dtype": "torch.float16", "ppl": 0}
|
src/envs.py
CHANGED
@@ -16,7 +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 |
-
HF_TOKEN_PRIVATE = os.environ.get("
|
20 |
|
21 |
# Check HF_HOME write access
|
22 |
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("H4_TOKEN")
|
20 |
|
21 |
# Check HF_HOME write access
|
22 |
print(f"Initial HF_HOME set to: {HF_HOME}")
|
src/leaderboard/build_leaderboard.py
CHANGED
@@ -35,6 +35,7 @@ def download_dataset(repo_id, local_dir, repo_type="dataset", max_attempts=3, ba
|
|
35 |
snapshot_download(
|
36 |
repo_id=repo_id,
|
37 |
local_dir=local_dir,
|
|
|
38 |
repo_type=repo_type,
|
39 |
tqdm_class=None,
|
40 |
token=HF_TOKEN_PRIVATE,
|
@@ -63,9 +64,10 @@ def build_leadearboard_df():
|
|
63 |
# Retrieve the leaderboard DataFrame
|
64 |
with open(f"{os.path.abspath(DATA_PATH)}/leaderboard.json", "r", encoding="utf-8") as eval_file:
|
65 |
f=json.load(eval_file)
|
|
|
|
|
66 |
leaderboard_df = pd.DataFrame.from_records(f)[['model','moviesmc','musicmc','lawmc','booksmc','model_dtype','ppl']]
|
67 |
leaderboard_df['avg'] = leaderboard_df[['moviesmc','musicmc','lawmc','booksmc']].mean(axis=1)
|
68 |
numeric_cols = leaderboard_df.select_dtypes(include=['number']).columns
|
69 |
leaderboard_df[numeric_cols] = leaderboard_df[numeric_cols].round(3)
|
70 |
-
print(f)
|
71 |
return leaderboard_df.copy()
|
|
|
35 |
snapshot_download(
|
36 |
repo_id=repo_id,
|
37 |
local_dir=local_dir,
|
38 |
+
cache_dir='./tmp',
|
39 |
repo_type=repo_type,
|
40 |
tqdm_class=None,
|
41 |
token=HF_TOKEN_PRIVATE,
|
|
|
64 |
# Retrieve the leaderboard DataFrame
|
65 |
with open(f"{os.path.abspath(DATA_PATH)}/leaderboard.json", "r", encoding="utf-8") as eval_file:
|
66 |
f=json.load(eval_file)
|
67 |
+
print(f)
|
68 |
+
|
69 |
leaderboard_df = pd.DataFrame.from_records(f)[['model','moviesmc','musicmc','lawmc','booksmc','model_dtype','ppl']]
|
70 |
leaderboard_df['avg'] = leaderboard_df[['moviesmc','musicmc','lawmc','booksmc']].mean(axis=1)
|
71 |
numeric_cols = leaderboard_df.select_dtypes(include=['number']).columns
|
72 |
leaderboard_df[numeric_cols] = leaderboard_df[numeric_cols].round(3)
|
|
|
73 |
return leaderboard_df.copy()
|