Spaces:
Running
Running
upd
Browse files- app.py +54 -15
- data/.gitattributes +55 -0
- data/README.md +3 -0
- data/leaderboard.json +1 -0
- genned.json +1 -0
- m_data/.gitattributes +55 -0
- m_data/README.md +3 -0
- m_data/leaderboard.json +11 -0
- m_data/model_data/external/saiga_3_8bapsys.json +1 -0
- src/display/about.py +11 -11
- src/display/utils.py +9 -10
- src/envs.py +2 -2
- src/leaderboard/build_leaderboard.py +9 -5
app.py
CHANGED
@@ -6,6 +6,9 @@ import gradio as gr
|
|
6 |
from apscheduler.schedulers.background import BackgroundScheduler
|
7 |
from gradio_leaderboard import Leaderboard, SelectColumns
|
8 |
from gradio_space_ci import enable_space_ci
|
|
|
|
|
|
|
9 |
|
10 |
from src.display.about import (
|
11 |
INTRODUCTION_TEXT,
|
@@ -17,7 +20,9 @@ from src.display.utils import (
|
|
17 |
fields,
|
18 |
)
|
19 |
from src.envs import API, H4_TOKEN, HF_HOME, REPO_ID, RESET_JUDGEMENT_ENV
|
20 |
-
from src.leaderboard.build_leaderboard import build_leadearboard_df, download_openbench
|
|
|
|
|
21 |
|
22 |
os.environ["GRADIO_ANALYTICS_ENABLED"] = "false"
|
23 |
|
@@ -27,15 +32,16 @@ logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(
|
|
27 |
# Start ephemeral Spaces on PRs (see config in README.md)
|
28 |
enable_space_ci()
|
29 |
|
30 |
-
download_openbench()
|
31 |
|
|
|
32 |
|
33 |
def restart_space():
|
34 |
-
API.restart_space(repo_id=REPO_ID
|
|
|
35 |
|
36 |
|
37 |
def build_demo():
|
38 |
-
demo = gr.Blocks(title="
|
39 |
leaderboard_df = build_leadearboard_df()
|
40 |
with demo:
|
41 |
gr.HTML(TITLE)
|
@@ -71,13 +77,28 @@ def build_demo():
|
|
71 |
model_name_textbox = gr.Textbox(label="Model name")
|
72 |
submitter_username = gr.Textbox(label="Username")
|
73 |
|
74 |
-
def upload_file(file):
|
75 |
file_path = file.name.split("/")[-1] if "/" in file.name else file.name
|
76 |
logging.info("New submition: file saved to %s", file_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
API.upload_file(
|
78 |
-
path_or_fileobj=
|
79 |
-
path_in_repo="
|
80 |
-
repo_id="Vikhrmodels/openbench-eval",
|
81 |
repo_type="dataset",
|
82 |
)
|
83 |
os.environ[RESET_JUDGEMENT_ENV] = "1"
|
@@ -88,7 +109,7 @@ def build_demo():
|
|
88 |
upload_button = gr.UploadButton(
|
89 |
"Click to Upload & Submit Answers", file_types=["*"], file_count="single"
|
90 |
)
|
91 |
-
upload_button.upload(upload_file, upload_button, file_output)
|
92 |
|
93 |
return demo
|
94 |
|
@@ -103,22 +124,40 @@ def update_board():
|
|
103 |
if need_reset != "1":
|
104 |
return
|
105 |
os.environ[RESET_JUDGEMENT_ENV] = "0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
# gen_judgement_file = os.path.join(HF_HOME, "src/gen/gen_judgement.py")
|
108 |
# subprocess.run(["python3", gen_judgement_file], check=True)
|
109 |
|
110 |
-
show_result_file = os.path.join(HF_HOME, "src/gen/show_result.py")
|
111 |
-
subprocess.run(["python3", show_result_file, "--output"], check=True)
|
112 |
-
|
113 |
-
# update the gr item with leaderboard
|
114 |
-
# TODO
|
115 |
|
116 |
|
117 |
if __name__ == "__main__":
|
118 |
os.environ[RESET_JUDGEMENT_ENV] = "1"
|
119 |
|
120 |
scheduler = BackgroundScheduler()
|
121 |
-
scheduler.add_job(update_board, "interval", minutes=
|
122 |
scheduler.start()
|
123 |
|
124 |
demo_app = build_demo()
|
|
|
6 |
from apscheduler.schedulers.background import BackgroundScheduler
|
7 |
from gradio_leaderboard import Leaderboard, SelectColumns
|
8 |
from gradio_space_ci import enable_space_ci
|
9 |
+
import json
|
10 |
+
from io import BytesIO
|
11 |
+
|
12 |
|
13 |
from src.display.about import (
|
14 |
INTRODUCTION_TEXT,
|
|
|
20 |
fields,
|
21 |
)
|
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 |
|
|
|
32 |
# Start ephemeral Spaces on PRs (see config in README.md)
|
33 |
enable_space_ci()
|
34 |
|
|
|
35 |
|
36 |
+
download_openbench()
|
37 |
|
38 |
def restart_space():
|
39 |
+
API.restart_space(repo_id=REPO_ID)
|
40 |
+
download_openbench()
|
41 |
|
42 |
|
43 |
def build_demo():
|
44 |
+
demo = gr.Blocks(title="Small Shlepa", css=custom_css)
|
45 |
leaderboard_df = build_leadearboard_df()
|
46 |
with demo:
|
47 |
gr.HTML(TITLE)
|
|
|
77 |
model_name_textbox = gr.Textbox(label="Model name")
|
78 |
submitter_username = gr.Textbox(label="Username")
|
79 |
|
80 |
+
def upload_file(file,su,mn):
|
81 |
file_path = file.name.split("/")[-1] if "/" in file.name else file.name
|
82 |
logging.info("New submition: file saved to %s", file_path)
|
83 |
+
with open(file.name, "r") as f:
|
84 |
+
v=json.load(f)
|
85 |
+
new_file = v['results']
|
86 |
+
new_file['model'] = mn+"/"+su
|
87 |
+
new_file['moviesmc']=new_file['moviemc']["acc,none"]
|
88 |
+
new_file['musicmc']=new_file['musicmc']["acc,none"]
|
89 |
+
new_file['booksmc']=new_file['bookmc']["acc,none"]
|
90 |
+
new_file['lawmc']=new_file['lawmc']["acc,none"]
|
91 |
+
# name = v['config']["model_args"].split('=')[1].split(',')[0]
|
92 |
+
new_file['model_dtype'] = v['config']["model_dtype"]
|
93 |
+
new_file['ppl'] = 0
|
94 |
+
new_file.pop('moviemc')
|
95 |
+
new_file.pop('bookmc')
|
96 |
+
buf = BytesIO()
|
97 |
+
buf.write(json.dumps(new_file).encode('utf-8'))
|
98 |
API.upload_file(
|
99 |
+
path_or_fileobj=buf,
|
100 |
+
path_in_repo="model_data/external/" + su+mn + ".json",
|
101 |
+
repo_id="Vikhrmodels/s-openbench-eval",
|
102 |
repo_type="dataset",
|
103 |
)
|
104 |
os.environ[RESET_JUDGEMENT_ENV] = "1"
|
|
|
109 |
upload_button = gr.UploadButton(
|
110 |
"Click to Upload & Submit Answers", file_types=["*"], file_count="single"
|
111 |
)
|
112 |
+
upload_button.upload(upload_file, [upload_button,model_name_textbox,submitter_username], file_output)
|
113 |
|
114 |
return demo
|
115 |
|
|
|
124 |
if need_reset != "1":
|
125 |
return
|
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 |
+
|
142 |
+
|
143 |
+
API.upload_file(
|
144 |
+
path_or_fileobj="genned.json",
|
145 |
+
path_in_repo="leaderboard.json",
|
146 |
+
repo_id="Vikhrmodels/s-shlepa-metainfo",
|
147 |
+
repo_type="dataset",
|
148 |
+
)
|
149 |
+
restart_space()
|
150 |
|
151 |
# gen_judgement_file = os.path.join(HF_HOME, "src/gen/gen_judgement.py")
|
152 |
# subprocess.run(["python3", gen_judgement_file], check=True)
|
153 |
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
|
156 |
if __name__ == "__main__":
|
157 |
os.environ[RESET_JUDGEMENT_ENV] = "1"
|
158 |
|
159 |
scheduler = BackgroundScheduler()
|
160 |
+
scheduler.add_job(update_board, "interval", minutes=1)
|
161 |
scheduler.start()
|
162 |
|
163 |
demo_app = build_demo()
|
data/.gitattributes
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
27 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
37 |
+
# Audio files - uncompressed
|
38 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
39 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
40 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
41 |
+
# Audio files - compressed
|
42 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
43 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
44 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
45 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
46 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
47 |
+
# Image files - uncompressed
|
48 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
49 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
50 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
51 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
52 |
+
# Image files - compressed
|
53 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
data/README.md
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
data/leaderboard.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[{"musicmc": 0.3021276595744681, "lawmc": 0.2800829875518672, "model": "apsys/saiga_3_8b", "moviesmc": 0.3472222222222222, "booksmc": 0.2800829875518672, "model_dtype": "torch.float16", "ppl": 0}]
|
genned.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[{"musicmc": 0.3021276595744681, "lawmc": 0.2800829875518672, "model": "apsys/saiga_3_8b", "moviesmc": 0.3472222222222222, "booksmc": 0.2800829875518672, "model_dtype": "torch.float16", "ppl": 0}]
|
m_data/.gitattributes
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
27 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
37 |
+
# Audio files - uncompressed
|
38 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
39 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
40 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
41 |
+
# Audio files - compressed
|
42 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
43 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
44 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
45 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
46 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
47 |
+
# Image files - uncompressed
|
48 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
49 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
50 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
51 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
52 |
+
# Image files - compressed
|
53 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
m_data/README.md
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
m_data/leaderboard.json
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"musicmc": 0,
|
4 |
+
"lawmc": 0.2800829875518672,
|
5 |
+
"moviesmc": 0.3472222222222222,
|
6 |
+
"booksmc": 0.2800829875518672,
|
7 |
+
"model_dtype": "torch.float16",
|
8 |
+
"model": "apsys/apsys1",
|
9 |
+
"ppl": 0
|
10 |
+
}
|
11 |
+
]
|
m_data/model_data/external/saiga_3_8bapsys.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"musicmc": 0.3021276595744681, "lawmc": 0.2800829875518672, "model": "apsys/saiga_3_8b", "moviesmc": 0.3472222222222222, "booksmc": 0.2800829875518672, "model_dtype": "torch.float16", "ppl": 0}
|
src/display/about.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
from src.display.utils import ModelType
|
2 |
|
3 |
-
TITLE = """<h1 style="text-align:left;float:left; id="space-title">🤗
|
4 |
|
5 |
INTRODUCTION_TEXT = """
|
6 |
"""
|
@@ -10,7 +10,7 @@ icons = f"""
|
|
10 |
- {ModelType.CPT.to_str(" : ")} model: new, base models, continuously trained on further corpus (which may include IFT/chat data) using masked modelling
|
11 |
- {ModelType.FT.to_str(" : ")} model: pretrained models finetuned on more data
|
12 |
- {ModelType.chat.to_str(" : ")} model: chat like fine-tunes, either using IFT (datasets of task instruction), RLHF or DPO (changing the model loss a bit with an added policy), etc
|
13 |
-
- {ModelType.merges.to_str(" : ")} model: merges or MoErges, models which have been merged or fused without additional fine-tuning.
|
14 |
"""
|
15 |
LLM_BENCHMARKS_TEXT = """
|
16 |
## ABOUT
|
@@ -19,7 +19,7 @@ With the plethora of large language models (LLMs) and chatbots being released we
|
|
19 |
🤗 Submit a model for automated evaluation on the 🤗 GPU cluster on the "Submit" page!
|
20 |
The leaderboard's backend runs the great [Eleuther AI Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) - read more details below!
|
21 |
|
22 |
-
### Tasks
|
23 |
📈 We evaluate models on 6 key benchmarks using the <a href="https://github.com/EleutherAI/lm-evaluation-harness" target="_blank"> Eleuther AI Language Model Evaluation Harness </a>, a unified framework to test generative language models on a large number of different evaluation tasks.
|
24 |
|
25 |
- <a href="https://arxiv.org/abs/1803.05457" target="_blank"> AI2 Reasoning Challenge </a> (25-shot) - a set of grade-school science questions.
|
@@ -67,7 +67,7 @@ The tasks and few shots parameters are:
|
|
67 |
- Winogrande: 5-shot, *winogrande* (`acc`)
|
68 |
- GSM8k: 5-shot, *gsm8k* (`acc`)
|
69 |
|
70 |
-
Side note on the baseline scores:
|
71 |
- for log-likelihood evaluation, we select the random baseline
|
72 |
- for GSM8K, we select the score obtained in the paper after finetuning a 6B model on the full GSM8K training set for 50 epochs
|
73 |
|
@@ -97,7 +97,7 @@ FAQ_TEXT = """
|
|
97 |
My model requires `trust_remote_code=True`, can I submit it?
|
98 |
- *We only support models that have been integrated into a stable version of the `transformers` library for automatic submission, as we don't want to run possibly unsafe code on our cluster.*
|
99 |
|
100 |
-
What about models of type X?
|
101 |
- *We only support models that have been integrated into a stable version of the `transformers` library for automatic submission.*
|
102 |
|
103 |
How can I follow when my model is launched?
|
@@ -110,7 +110,7 @@ What causes an evaluation failure?
|
|
110 |
- *Most of the failures we get come from problems in the submissions (corrupted files, config problems, wrong parameters selected for eval ...), so we'll be grateful if you first make sure you have followed the steps in `About`. However, from time to time, we have failures on our side (hardware/node failures, problems with an update of our backend, connectivity problems ending up in the results not being saved, ...).*
|
111 |
|
112 |
How can I report an evaluation failure?
|
113 |
-
- *As we store the logs for all models, feel free to create an issue, **where you link to the requests file of your model** (look for it [here](https://huggingface.co/datasets/open-llm-leaderboard/requests/tree/main)), so we can investigate! If the model failed due to a problem on our side, we'll relaunch it right away!*
|
114 |
*Note: Please do not re-upload your model under a different name, it will not help*
|
115 |
|
116 |
---------------------------
|
@@ -123,7 +123,7 @@ What kind of information can I find?
|
|
123 |
- *The [details dataset](https://huggingface.co/datasets/open-llm-leaderboard/details_01-ai__Yi-34B/tree/main): it gives you the full details (scores and examples for each task and a given model)*
|
124 |
|
125 |
|
126 |
-
Why do models appear several times in the leaderboard?
|
127 |
- *We run evaluations with user-selected precision and model commit. Sometimes, users submit specific models at different commits and at different precisions (for example, in float16 and 4bit to see how quantization affects performance). You should be able to verify this by displaying the `precision` and `model sha` columns in the display. If, however, you see models appearing several times with the same precision and hash commit, this is not normal.*
|
128 |
|
129 |
What is this concept of "flagging"?
|
@@ -145,7 +145,7 @@ Search for models in the leaderboard by:
|
|
145 |
|
146 |
## EDITING SUBMISSIONS
|
147 |
I upgraded my model and want to re-submit, how can I do that?
|
148 |
-
- *Please open an issue with the precise name of your model, and we'll remove your model from the leaderboard so you can resubmit. You can also resubmit directly with the new commit hash!*
|
149 |
|
150 |
I need to rename my model, how can I do that?
|
151 |
- *You can use @Weyaxi 's [super cool tool](https://huggingface.co/spaces/Weyaxi/open-llm-leaderboard-renamer) to request model name changes, then open a discussion where you link to the created pull request, and we'll check them and merge them as needed.*
|
@@ -154,14 +154,14 @@ I need to rename my model, how can I do that?
|
|
154 |
|
155 |
## OTHER
|
156 |
Why do you differentiate between pretrained, continuously pretrained, fine-tuned, merges, etc?
|
157 |
-
- *These different models do not play in the same categories, and therefore need to be separated for fair comparison. Base pretrained models are the most interesting for the community, as they are usually good models to fine-tune later on - any jump in performance from a pretrained model represents a true improvement on the SOTA.
|
158 |
-
Fine-tuned and IFT/RLHF/chat models usually have better performance, but the latter might be more sensitive to system prompts, which we do not cover at the moment in the Open LLM Leaderboard.
|
159 |
Merges and moerges have artificially inflated performance on test sets, which is not always explainable, and does not always apply to real-world situations.*
|
160 |
|
161 |
What should I use the leaderboard for?
|
162 |
- *We recommend using the leaderboard for 3 use cases: 1) getting an idea of the state of open pretrained models, by looking only at the ranks and score of this category; 2) experimenting with different fine-tuning methods, datasets, quantization techniques, etc, and comparing their score in a reproducible setup, and 3) checking the performance of a model of interest to you, wrt to other models of its category.*
|
163 |
|
164 |
-
Why don't you display closed-source model scores?
|
165 |
- *This is a leaderboard for Open models, both for philosophical reasons (openness is cool) and for practical reasons: we want to ensure that the results we display are accurate and reproducible, but 1) commercial closed models can change their API thus rendering any scoring at a given time incorrect 2) we re-run everything on our cluster to ensure all models are run on the same setup and you can't do that for these models.*
|
166 |
|
167 |
I have an issue with accessing the leaderboard through the Gradio API
|
|
|
1 |
from src.display.utils import ModelType
|
2 |
|
3 |
+
TITLE = """<h1 style="text-align:left;float:left; id="space-title">🤗 Small Shlepa LLM Leaderboard</h1> <h3 style="text-align:left;float:left;> Track, rank and evaluate open LLMs and chatbots </h3>"""
|
4 |
|
5 |
INTRODUCTION_TEXT = """
|
6 |
"""
|
|
|
10 |
- {ModelType.CPT.to_str(" : ")} model: new, base models, continuously trained on further corpus (which may include IFT/chat data) using masked modelling
|
11 |
- {ModelType.FT.to_str(" : ")} model: pretrained models finetuned on more data
|
12 |
- {ModelType.chat.to_str(" : ")} model: chat like fine-tunes, either using IFT (datasets of task instruction), RLHF or DPO (changing the model loss a bit with an added policy), etc
|
13 |
+
- {ModelType.merges.to_str(" : ")} model: merges or MoErges, models which have been merged or fused without additional fine-tuning.
|
14 |
"""
|
15 |
LLM_BENCHMARKS_TEXT = """
|
16 |
## ABOUT
|
|
|
19 |
🤗 Submit a model for automated evaluation on the 🤗 GPU cluster on the "Submit" page!
|
20 |
The leaderboard's backend runs the great [Eleuther AI Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) - read more details below!
|
21 |
|
22 |
+
### Tasks
|
23 |
📈 We evaluate models on 6 key benchmarks using the <a href="https://github.com/EleutherAI/lm-evaluation-harness" target="_blank"> Eleuther AI Language Model Evaluation Harness </a>, a unified framework to test generative language models on a large number of different evaluation tasks.
|
24 |
|
25 |
- <a href="https://arxiv.org/abs/1803.05457" target="_blank"> AI2 Reasoning Challenge </a> (25-shot) - a set of grade-school science questions.
|
|
|
67 |
- Winogrande: 5-shot, *winogrande* (`acc`)
|
68 |
- GSM8k: 5-shot, *gsm8k* (`acc`)
|
69 |
|
70 |
+
Side note on the baseline scores:
|
71 |
- for log-likelihood evaluation, we select the random baseline
|
72 |
- for GSM8K, we select the score obtained in the paper after finetuning a 6B model on the full GSM8K training set for 50 epochs
|
73 |
|
|
|
97 |
My model requires `trust_remote_code=True`, can I submit it?
|
98 |
- *We only support models that have been integrated into a stable version of the `transformers` library for automatic submission, as we don't want to run possibly unsafe code on our cluster.*
|
99 |
|
100 |
+
What about models of type X?
|
101 |
- *We only support models that have been integrated into a stable version of the `transformers` library for automatic submission.*
|
102 |
|
103 |
How can I follow when my model is launched?
|
|
|
110 |
- *Most of the failures we get come from problems in the submissions (corrupted files, config problems, wrong parameters selected for eval ...), so we'll be grateful if you first make sure you have followed the steps in `About`. However, from time to time, we have failures on our side (hardware/node failures, problems with an update of our backend, connectivity problems ending up in the results not being saved, ...).*
|
111 |
|
112 |
How can I report an evaluation failure?
|
113 |
+
- *As we store the logs for all models, feel free to create an issue, **where you link to the requests file of your model** (look for it [here](https://huggingface.co/datasets/open-llm-leaderboard/requests/tree/main)), so we can investigate! If the model failed due to a problem on our side, we'll relaunch it right away!*
|
114 |
*Note: Please do not re-upload your model under a different name, it will not help*
|
115 |
|
116 |
---------------------------
|
|
|
123 |
- *The [details dataset](https://huggingface.co/datasets/open-llm-leaderboard/details_01-ai__Yi-34B/tree/main): it gives you the full details (scores and examples for each task and a given model)*
|
124 |
|
125 |
|
126 |
+
Why do models appear several times in the leaderboard?
|
127 |
- *We run evaluations with user-selected precision and model commit. Sometimes, users submit specific models at different commits and at different precisions (for example, in float16 and 4bit to see how quantization affects performance). You should be able to verify this by displaying the `precision` and `model sha` columns in the display. If, however, you see models appearing several times with the same precision and hash commit, this is not normal.*
|
128 |
|
129 |
What is this concept of "flagging"?
|
|
|
145 |
|
146 |
## EDITING SUBMISSIONS
|
147 |
I upgraded my model and want to re-submit, how can I do that?
|
148 |
+
- *Please open an issue with the precise name of your model, and we'll remove your model from the leaderboard so you can resubmit. You can also resubmit directly with the new commit hash!*
|
149 |
|
150 |
I need to rename my model, how can I do that?
|
151 |
- *You can use @Weyaxi 's [super cool tool](https://huggingface.co/spaces/Weyaxi/open-llm-leaderboard-renamer) to request model name changes, then open a discussion where you link to the created pull request, and we'll check them and merge them as needed.*
|
|
|
154 |
|
155 |
## OTHER
|
156 |
Why do you differentiate between pretrained, continuously pretrained, fine-tuned, merges, etc?
|
157 |
+
- *These different models do not play in the same categories, and therefore need to be separated for fair comparison. Base pretrained models are the most interesting for the community, as they are usually good models to fine-tune later on - any jump in performance from a pretrained model represents a true improvement on the SOTA.
|
158 |
+
Fine-tuned and IFT/RLHF/chat models usually have better performance, but the latter might be more sensitive to system prompts, which we do not cover at the moment in the Open LLM Leaderboard.
|
159 |
Merges and moerges have artificially inflated performance on test sets, which is not always explainable, and does not always apply to real-world situations.*
|
160 |
|
161 |
What should I use the leaderboard for?
|
162 |
- *We recommend using the leaderboard for 3 use cases: 1) getting an idea of the state of open pretrained models, by looking only at the ranks and score of this category; 2) experimenting with different fine-tuning methods, datasets, quantization techniques, etc, and comparing their score in a reproducible setup, and 3) checking the performance of a model of interest to you, wrt to other models of its category.*
|
163 |
|
164 |
+
Why don't you display closed-source model scores?
|
165 |
- *This is a leaderboard for Open models, both for philosophical reasons (openness is cool) and for practical reasons: we want to ensure that the results we display are accurate and reproducible, but 1) commercial closed models can change their API thus rendering any scoring at a given time incorrect 2) we re-run everything on our cluster to ensure all models are run on the same setup and you can't do that for these models.*
|
166 |
|
167 |
I have an issue with accessing the leaderboard through the Gradio API
|
src/display/utils.py
CHANGED
@@ -49,12 +49,10 @@ class Task:
|
|
49 |
|
50 |
|
51 |
class Tasks(Enum):
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
winogrande = Task("winogrande", "acc", "Winogrande")
|
57 |
-
gsm8k = Task("gsm8k", "acc", "GSM8K")
|
58 |
|
59 |
|
60 |
# These classes are for user facing column names,
|
@@ -75,11 +73,12 @@ auto_eval_column_dict = []
|
|
75 |
# auto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])
|
76 |
auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("model", "markdown", True, never_hidden=True)])
|
77 |
# # Scores
|
78 |
-
auto_eval_column_dict.append(["score", ColumnContent, ColumnContent("score", "number", True)])
|
79 |
-
|
80 |
-
|
81 |
# # Model information
|
82 |
-
|
|
|
83 |
# auto_eval_column_dict.append(["architecture", ColumnContent, ColumnContent("Architecture", "str", False)])
|
84 |
# auto_eval_column_dict.append(["weight_type", ColumnContent, ColumnContent("Weight type", "str", False, True)])
|
85 |
# auto_eval_column_dict.append(["precision", ColumnContent, ColumnContent("Precision", "str", False)])
|
|
|
49 |
|
50 |
|
51 |
class Tasks(Enum):
|
52 |
+
books = Task("booksmc", "acc", "booksmc")
|
53 |
+
movies = Task("moviesmc", "acc", "moviesmc")
|
54 |
+
music = Task("musicmc", "acc", "musicmc")
|
55 |
+
law = Task("lawmc", "acc", "lawmc")
|
|
|
|
|
56 |
|
57 |
|
58 |
# These classes are for user facing column names,
|
|
|
73 |
# auto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])
|
74 |
auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("model", "markdown", True, never_hidden=True)])
|
75 |
# # Scores
|
76 |
+
# auto_eval_column_dict.append(["score", ColumnContent, ColumnContent("score", "number", True)])
|
77 |
+
for task in Tasks:
|
78 |
+
auto_eval_column_dict.append([task.name, ColumnContent, ColumnContent(task.value.col_name, "number", True)])
|
79 |
# # Model information
|
80 |
+
auto_eval_column_dict.append(["ppl", ColumnContent, ColumnContent("Type", "number", 0)])
|
81 |
+
auto_eval_column_dict.append(["model_dtype", ColumnContent, ColumnContent("Type", "number", 0)])
|
82 |
# auto_eval_column_dict.append(["architecture", ColumnContent, ColumnContent("Architecture", "str", False)])
|
83 |
# auto_eval_column_dict.append(["weight_type", ColumnContent, ColumnContent("Weight type", "str", False, True)])
|
84 |
# auto_eval_column_dict.append(["precision", ColumnContent, ColumnContent("Precision", "str", False)])
|
src/envs.py
CHANGED
@@ -5,7 +5,7 @@ from huggingface_hub import HfApi
|
|
5 |
# clone / pull the lmeh eval data
|
6 |
H4_TOKEN = os.environ.get("H4_TOKEN", None)
|
7 |
|
8 |
-
REPO_ID = "
|
9 |
QUEUE_REPO = "open-llm-leaderboard/requests"
|
10 |
DYNAMIC_INFO_REPO = "open-llm-leaderboard/dynamic_model_information"
|
11 |
RESULTS_REPO = "open-llm-leaderboard/results"
|
@@ -29,7 +29,7 @@ else:
|
|
29 |
print("Write access confirmed for HF_HOME")
|
30 |
|
31 |
DATA_PATH = os.path.join(HF_HOME, "data")
|
32 |
-
DATA_ARENA_PATH = os.path.join(DATA_PATH, "arena-hard-v0.1")
|
33 |
|
34 |
RESET_JUDGEMENT_ENV = "RESET_JUDGEMENT"
|
35 |
|
|
|
5 |
# clone / pull the lmeh eval data
|
6 |
H4_TOKEN = os.environ.get("H4_TOKEN", None)
|
7 |
|
8 |
+
REPO_ID = "Vikhrmodels/small-shlepa"
|
9 |
QUEUE_REPO = "open-llm-leaderboard/requests"
|
10 |
DYNAMIC_INFO_REPO = "open-llm-leaderboard/dynamic_model_information"
|
11 |
RESULTS_REPO = "open-llm-leaderboard/results"
|
|
|
29 |
print("Write access confirmed for HF_HOME")
|
30 |
|
31 |
DATA_PATH = os.path.join(HF_HOME, "data")
|
32 |
+
# DATA_ARENA_PATH = os.path.join(DATA_PATH, "arena-hard-v0.1")
|
33 |
|
34 |
RESET_JUDGEMENT_ENV = "RESET_JUDGEMENT"
|
35 |
|
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
|
10 |
|
11 |
# Configure logging
|
12 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
@@ -53,14 +53,18 @@ def download_dataset(repo_id, local_dir, repo_type="dataset", max_attempts=3, ba
|
|
53 |
|
54 |
def download_openbench():
|
55 |
# download prev autogenerated leaderboard files
|
56 |
-
download_dataset("Vikhrmodels/
|
57 |
|
58 |
# download answers of different models that we trust
|
59 |
-
download_dataset("Vikhrmodels/openbench-eval",
|
60 |
|
61 |
|
62 |
def build_leadearboard_df():
|
63 |
# Retrieve the leaderboard DataFrame
|
64 |
-
with open(f"{DATA_PATH}/leaderboard.json", "r", encoding="utf-8") as eval_file:
|
65 |
-
|
|
|
|
|
|
|
|
|
66 |
return leaderboard_df.copy()
|
|
|
6 |
import pandas as pd
|
7 |
from huggingface_hub import snapshot_download
|
8 |
|
9 |
+
from src.envs import DATA_PATH, HF_TOKEN_PRIVATE
|
10 |
|
11 |
# Configure logging
|
12 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
|
|
53 |
|
54 |
def download_openbench():
|
55 |
# download prev autogenerated leaderboard files
|
56 |
+
download_dataset("Vikhrmodels/s-shlepa-metainfo", DATA_PATH)
|
57 |
|
58 |
# download answers of different models that we trust
|
59 |
+
download_dataset("Vikhrmodels/s-openbench-eval", "m_data")
|
60 |
|
61 |
|
62 |
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 |
+
numeric_cols = leaderboard_df.select_dtypes(include=['number']).columns
|
68 |
+
leaderboard_df[numeric_cols] = leaderboard_df[numeric_cols].round(3)
|
69 |
+
print(f)
|
70 |
return leaderboard_df.copy()
|