Spaces:
Runtime error
Runtime error
felix
commited on
Commit
·
5f65cec
1
Parent(s):
ae85651
update with app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import json
|
2 |
import os
|
|
|
3 |
|
4 |
import gradio as gr
|
5 |
import pandas as pd
|
@@ -85,13 +86,13 @@ def change_tab(query_param: str):
|
|
85 |
|
86 |
# Searching and filtering
|
87 |
def update_table(
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
):
|
96 |
filtered_df = filter_models(hidden_df, type_query, size_query, precision_query, show_deleted)
|
97 |
filtered_df = filter_queries(query, filtered_df)
|
@@ -111,7 +112,7 @@ def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
|
|
111 |
# We use COLS to maintain sorting
|
112 |
filtered_df = df[
|
113 |
always_here_cols + [c for c in COLS if c in df.columns and c in columns] + [AutoEvalColumn.dummy.name]
|
114 |
-
|
115 |
return filtered_df
|
116 |
|
117 |
|
@@ -136,7 +137,7 @@ def filter_queries(query: str, filtered_df: pd.DataFrame):
|
|
136 |
|
137 |
|
138 |
def filter_models(
|
139 |
-
|
140 |
) -> pd.DataFrame:
|
141 |
# Show all models
|
142 |
if show_deleted:
|
@@ -156,293 +157,371 @@ def filter_models(
|
|
156 |
return filtered_df
|
157 |
|
158 |
|
159 |
-
demo = gr.Blocks(css=custom_css)
|
160 |
-
with demo:
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
value=original_df[COLS],
|
227 |
-
headers=COLS,
|
228 |
-
datatype=TYPES,
|
229 |
-
max_rows=None,
|
230 |
-
visible=False,
|
231 |
-
)
|
232 |
-
search_bar.submit(
|
233 |
-
update_table,
|
234 |
-
[
|
235 |
-
hidden_leaderboard_table_for_search,
|
236 |
-
shown_columns,
|
237 |
-
filter_columns_type,
|
238 |
-
filter_columns_precision,
|
239 |
-
filter_columns_size,
|
240 |
-
deleted_models_visibility,
|
241 |
-
search_bar,
|
242 |
-
],
|
243 |
-
leaderboard_table,
|
244 |
-
)
|
245 |
-
shown_columns.change(
|
246 |
-
update_table,
|
247 |
-
[
|
248 |
-
hidden_leaderboard_table_for_search,
|
249 |
-
shown_columns,
|
250 |
-
filter_columns_type,
|
251 |
-
filter_columns_precision,
|
252 |
-
filter_columns_size,
|
253 |
-
deleted_models_visibility,
|
254 |
-
search_bar,
|
255 |
-
],
|
256 |
-
leaderboard_table,
|
257 |
-
queue=True,
|
258 |
-
)
|
259 |
-
filter_columns_type.change(
|
260 |
-
update_table,
|
261 |
-
[
|
262 |
-
hidden_leaderboard_table_for_search,
|
263 |
-
shown_columns,
|
264 |
-
filter_columns_type,
|
265 |
-
filter_columns_precision,
|
266 |
-
filter_columns_size,
|
267 |
-
deleted_models_visibility,
|
268 |
-
search_bar,
|
269 |
-
],
|
270 |
-
leaderboard_table,
|
271 |
-
queue=True,
|
272 |
-
)
|
273 |
-
filter_columns_precision.change(
|
274 |
-
update_table,
|
275 |
-
[
|
276 |
-
hidden_leaderboard_table_for_search,
|
277 |
-
shown_columns,
|
278 |
-
filter_columns_type,
|
279 |
-
filter_columns_precision,
|
280 |
-
filter_columns_size,
|
281 |
-
deleted_models_visibility,
|
282 |
-
search_bar,
|
283 |
-
],
|
284 |
-
leaderboard_table,
|
285 |
-
queue=True,
|
286 |
-
)
|
287 |
-
filter_columns_size.change(
|
288 |
-
update_table,
|
289 |
-
[
|
290 |
-
hidden_leaderboard_table_for_search,
|
291 |
-
shown_columns,
|
292 |
-
filter_columns_type,
|
293 |
-
filter_columns_precision,
|
294 |
-
filter_columns_size,
|
295 |
-
deleted_models_visibility,
|
296 |
-
search_bar,
|
297 |
-
],
|
298 |
-
leaderboard_table,
|
299 |
-
queue=True,
|
300 |
-
)
|
301 |
-
deleted_models_visibility.change(
|
302 |
-
update_table,
|
303 |
-
[
|
304 |
-
hidden_leaderboard_table_for_search,
|
305 |
-
shown_columns,
|
306 |
-
filter_columns_type,
|
307 |
-
filter_columns_precision,
|
308 |
-
filter_columns_size,
|
309 |
-
deleted_models_visibility,
|
310 |
-
search_bar,
|
311 |
-
],
|
312 |
-
leaderboard_table,
|
313 |
-
queue=True,
|
314 |
-
)
|
315 |
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
# chart = create_metric_plot_obj(
|
321 |
-
# plot_df,
|
322 |
-
# ["Average ⬆️"],
|
323 |
-
# HUMAN_BASELINES,
|
324 |
-
# title="Average of Top Scores and Human Baseline Over Time",
|
325 |
-
# )
|
326 |
-
# gr.Plot(value=chart, interactive=False, width=500, height=500)
|
327 |
-
# with gr.Column():
|
328 |
-
# chart = create_metric_plot_obj(
|
329 |
-
# plot_df,
|
330 |
-
# ["ARC", "HellaSwag", "MMLU", "TruthfulQA", "Winogrande", "GSM8K", "DROP"],
|
331 |
-
# HUMAN_BASELINES,
|
332 |
-
# title="Top Scores and Human Baseline Over Time",
|
333 |
-
# )
|
334 |
-
# gr.Plot(value=chart, interactive=False, width=500, height=500)
|
335 |
-
with gr.TabItem("📝 About", elem_id="llm-benchmark-tab-table", id=2):
|
336 |
-
gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
337 |
-
|
338 |
-
with gr.TabItem("🚀 Submit here! ", elem_id="llm-benchmark-tab-table", id=3):
|
339 |
-
with gr.Column():
|
340 |
-
with gr.Row():
|
341 |
-
gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
|
342 |
-
|
343 |
-
with gr.Column():
|
344 |
-
with gr.Accordion(
|
345 |
-
f"✅ Finished Evaluations ({len(finished_eval_queue_df)})",
|
346 |
-
open=False,
|
347 |
-
):
|
348 |
-
with gr.Row():
|
349 |
-
finished_eval_table = gr.components.Dataframe(
|
350 |
-
value=finished_eval_queue_df,
|
351 |
-
headers=EVAL_COLS,
|
352 |
-
datatype=EVAL_TYPES,
|
353 |
-
max_rows=5,
|
354 |
-
)
|
355 |
-
with gr.Accordion(
|
356 |
-
f"🔄 Running Evaluation Queue ({len(running_eval_queue_df)})",
|
357 |
-
open=False,
|
358 |
-
):
|
359 |
-
with gr.Row():
|
360 |
-
running_eval_table = gr.components.Dataframe(
|
361 |
-
value=running_eval_queue_df,
|
362 |
-
headers=EVAL_COLS,
|
363 |
-
datatype=EVAL_TYPES,
|
364 |
-
max_rows=5,
|
365 |
-
)
|
366 |
-
|
367 |
-
with gr.Accordion(
|
368 |
-
f"⏳ Pending Evaluation Queue ({len(pending_eval_queue_df)})",
|
369 |
-
open=False,
|
370 |
-
):
|
371 |
-
with gr.Row():
|
372 |
-
pending_eval_table = gr.components.Dataframe(
|
373 |
-
value=pending_eval_queue_df,
|
374 |
-
headers=EVAL_COLS,
|
375 |
-
datatype=EVAL_TYPES,
|
376 |
-
max_rows=5,
|
377 |
-
)
|
378 |
-
with gr.Row():
|
379 |
-
gr.Markdown("# ✉️✨ Submit your model here!", elem_classes="markdown-text")
|
380 |
-
|
381 |
-
with gr.Row():
|
382 |
-
with gr.Column():
|
383 |
-
model_name_textbox = gr.Textbox(label="Model name")
|
384 |
-
revision_name_textbox = gr.Textbox(label="revision", placeholder="main")
|
385 |
-
private = gr.Checkbox(False, label="Private", visible=not IS_PUBLIC)
|
386 |
-
model_type = gr.Dropdown(
|
387 |
-
choices=[t.to_str(" : ") for t in ModelType],
|
388 |
-
label="Model type",
|
389 |
-
multiselect=False,
|
390 |
-
value=None,
|
391 |
-
interactive=True,
|
392 |
-
)
|
393 |
-
|
394 |
-
with gr.Column():
|
395 |
-
precision = gr.Dropdown(
|
396 |
-
choices=["float16", "bfloat16", "8bit (LLM.int8)", "4bit (QLoRA / FP4)", "GPTQ"],
|
397 |
-
label="Precision",
|
398 |
-
multiselect=False,
|
399 |
-
value="float16",
|
400 |
-
interactive=True,
|
401 |
-
)
|
402 |
-
weight_type = gr.Dropdown(
|
403 |
-
choices=["Original", "Delta", "Adapter"],
|
404 |
-
label="Weights type",
|
405 |
-
multiselect=False,
|
406 |
-
value="Original",
|
407 |
-
interactive=True,
|
408 |
-
)
|
409 |
-
base_model_name_textbox = gr.Textbox(label="Base model (for delta or adapter weights)")
|
410 |
-
|
411 |
-
submit_button = gr.Button("Submit Eval")
|
412 |
-
submission_result = gr.Markdown()
|
413 |
-
submit_button.click(
|
414 |
-
add_new_eval,
|
415 |
-
[
|
416 |
-
model_name_textbox,
|
417 |
-
base_model_name_textbox,
|
418 |
-
revision_name_textbox,
|
419 |
-
precision,
|
420 |
-
private,
|
421 |
-
weight_type,
|
422 |
-
model_type,
|
423 |
-
],
|
424 |
-
submission_result,
|
425 |
-
)
|
426 |
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
lines=20,
|
433 |
-
elem_id="citation-button",
|
434 |
-
show_copy_button=True,
|
435 |
-
)
|
436 |
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
444 |
|
445 |
-
|
446 |
-
|
447 |
-
scheduler.start()
|
448 |
-
demo.queue(concurrency_count=40).launch()
|
|
|
1 |
import json
|
2 |
import os
|
3 |
+
from datetime import datetime, timezone
|
4 |
|
5 |
import gradio as gr
|
6 |
import pandas as pd
|
|
|
86 |
|
87 |
# Searching and filtering
|
88 |
def update_table(
|
89 |
+
hidden_df: pd.DataFrame,
|
90 |
+
columns: list,
|
91 |
+
type_query: list,
|
92 |
+
precision_query: str,
|
93 |
+
size_query: list,
|
94 |
+
show_deleted: bool,
|
95 |
+
query: str,
|
96 |
):
|
97 |
filtered_df = filter_models(hidden_df, type_query, size_query, precision_query, show_deleted)
|
98 |
filtered_df = filter_queries(query, filtered_df)
|
|
|
112 |
# We use COLS to maintain sorting
|
113 |
filtered_df = df[
|
114 |
always_here_cols + [c for c in COLS if c in df.columns and c in columns] + [AutoEvalColumn.dummy.name]
|
115 |
+
]
|
116 |
return filtered_df
|
117 |
|
118 |
|
|
|
137 |
|
138 |
|
139 |
def filter_models(
|
140 |
+
df: pd.DataFrame, type_query: list, size_query: list, precision_query: list, show_deleted: bool
|
141 |
) -> pd.DataFrame:
|
142 |
# Show all models
|
143 |
if show_deleted:
|
|
|
157 |
return filtered_df
|
158 |
|
159 |
|
160 |
+
# demo = gr.Blocks(css=custom_css)
|
161 |
+
# with demo:
|
162 |
+
# gr.HTML(TITLE)
|
163 |
+
# gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
164 |
+
#
|
165 |
+
# with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
166 |
+
# with gr.TabItem("🏅 LLM Benchmark", elem_id="llm-benchmark-tab-table", id=0):
|
167 |
+
# with gr.Row():
|
168 |
+
# with gr.Column():
|
169 |
+
# with gr.Row():
|
170 |
+
# search_bar = gr.Textbox(
|
171 |
+
# placeholder=" 🔍 Search for your model and press ENTER...",
|
172 |
+
# show_label=False,
|
173 |
+
# elem_id="search-bar",
|
174 |
+
# )
|
175 |
+
# with gr.Row():
|
176 |
+
# shown_columns = gr.CheckboxGroup(
|
177 |
+
# choices=[
|
178 |
+
# c
|
179 |
+
# for c in COLS
|
180 |
+
# if c
|
181 |
+
# not in [
|
182 |
+
# AutoEvalColumn.dummy.name,
|
183 |
+
# AutoEvalColumn.model.name,
|
184 |
+
# AutoEvalColumn.model_type_symbol.name,
|
185 |
+
# AutoEvalColumn.still_on_hub.name,
|
186 |
+
# ]
|
187 |
+
# ],
|
188 |
+
# value=[
|
189 |
+
# c
|
190 |
+
# for c in COLS_LITE
|
191 |
+
# if c
|
192 |
+
# not in [
|
193 |
+
# AutoEvalColumn.dummy.name,
|
194 |
+
# AutoEvalColumn.model.name,
|
195 |
+
# AutoEvalColumn.model_type_symbol.name,
|
196 |
+
# AutoEvalColumn.still_on_hub.name,
|
197 |
+
# ]
|
198 |
+
# ],
|
199 |
+
# label="Select columns to show",
|
200 |
+
# elem_id="column-select",
|
201 |
+
# interactive=True,
|
202 |
+
# )
|
203 |
+
# with gr.Row():
|
204 |
+
# deleted_models_visibility = gr.Checkbox(
|
205 |
+
# value=True, label="Show gated/private/deleted models", interactive=True
|
206 |
+
# )
|
207 |
+
# with gr.Column(min_width=320):
|
208 |
+
# with gr.Box(elem_id="box-filter"):
|
209 |
+
# filter_columns_type = gr.CheckboxGroup(
|
210 |
+
# label="Model types",
|
211 |
+
# choices=[
|
212 |
+
# ModelType.PT.to_str(),
|
213 |
+
# ModelType.FT.to_str(),
|
214 |
+
# ModelType.IFT.to_str(),
|
215 |
+
# ModelType.RL.to_str(),
|
216 |
+
# ],
|
217 |
+
# value=[
|
218 |
+
# ModelType.PT.to_str(),
|
219 |
+
# ModelType.FT.to_str(),
|
220 |
+
# ModelType.IFT.to_str(),
|
221 |
+
# ModelType.RL.to_str(),
|
222 |
+
# ],
|
223 |
+
# interactive=True,
|
224 |
+
# elem_id="filter-columns-type",
|
225 |
+
# )
|
226 |
+
# filter_columns_precision = gr.CheckboxGroup(
|
227 |
+
# label="Precision",
|
228 |
+
# choices=["torch.float16", "torch.bfloat16", "torch.float32", "8bit", "4bit", "GPTQ"],
|
229 |
+
# value=["torch.float16", "torch.bfloat16", "torch.float32", "8bit", "4bit", "GPTQ"],
|
230 |
+
# interactive=True,
|
231 |
+
# elem_id="filter-columns-precision",
|
232 |
+
# )
|
233 |
+
# filter_columns_size = gr.CheckboxGroup(
|
234 |
+
# label="Model sizes",
|
235 |
+
# choices=list(NUMERIC_INTERVALS.keys()),
|
236 |
+
# value=list(NUMERIC_INTERVALS.keys()),
|
237 |
+
# interactive=True,
|
238 |
+
# elem_id="filter-columns-size",
|
239 |
+
# )
|
240 |
+
#
|
241 |
+
# leaderboard_table = gr.components.Dataframe(
|
242 |
+
# value=leaderboard_df[
|
243 |
+
# [AutoEvalColumn.model_type_symbol.name, AutoEvalColumn.model.name]
|
244 |
+
# + shown_columns.value
|
245 |
+
# + [AutoEvalColumn.dummy.name]
|
246 |
+
# ],
|
247 |
+
# headers=[
|
248 |
+
# AutoEvalColumn.model_type_symbol.name,
|
249 |
+
# AutoEvalColumn.model.name,
|
250 |
+
# ]
|
251 |
+
# + shown_columns.value
|
252 |
+
# + [AutoEvalColumn.dummy.name],
|
253 |
+
# datatype=TYPES,
|
254 |
+
# max_rows=None,
|
255 |
+
# elem_id="leaderboard-table",
|
256 |
+
# interactive=False,
|
257 |
+
# visible=True,
|
258 |
+
# )
|
259 |
+
#
|
260 |
+
# # Dummy leaderboard for handling the case when the user uses backspace key
|
261 |
+
# hidden_leaderboard_table_for_search = gr.components.Dataframe(
|
262 |
+
# value=original_df,
|
263 |
+
# headers=COLS,
|
264 |
+
# datatype=TYPES,
|
265 |
+
# max_rows=None,
|
266 |
+
# visible=False,
|
267 |
+
# )
|
268 |
+
# search_bar.submit(
|
269 |
+
# update_table,
|
270 |
+
# [
|
271 |
+
# hidden_leaderboard_table_for_search,
|
272 |
+
# leaderboard_table,
|
273 |
+
# shown_columns,
|
274 |
+
# filter_columns_type,
|
275 |
+
# filter_columns_precision,
|
276 |
+
# filter_columns_size,
|
277 |
+
# deleted_models_visibility,
|
278 |
+
# search_bar,
|
279 |
+
# ],
|
280 |
+
# leaderboard_table,
|
281 |
+
# )
|
282 |
+
# shown_columns.change(
|
283 |
+
# update_table,
|
284 |
+
# [
|
285 |
+
# hidden_leaderboard_table_for_search,
|
286 |
+
# leaderboard_table,
|
287 |
+
# shown_columns,
|
288 |
+
# filter_columns_type,
|
289 |
+
# filter_columns_precision,
|
290 |
+
# filter_columns_size,
|
291 |
+
# deleted_models_visibility,
|
292 |
+
# search_bar,
|
293 |
+
# ],
|
294 |
+
# leaderboard_table,
|
295 |
+
# queue=True,
|
296 |
+
# )
|
297 |
+
# filter_columns_type.change(
|
298 |
+
# update_table,
|
299 |
+
# [
|
300 |
+
# hidden_leaderboard_table_for_search,
|
301 |
+
# leaderboard_table,
|
302 |
+
# shown_columns,
|
303 |
+
# filter_columns_type,
|
304 |
+
# filter_columns_precision,
|
305 |
+
# filter_columns_size,
|
306 |
+
# deleted_models_visibility,
|
307 |
+
# search_bar,
|
308 |
+
# ],
|
309 |
+
# leaderboard_table,
|
310 |
+
# queue=True,
|
311 |
+
# )
|
312 |
+
# filter_columns_precision.change(
|
313 |
+
# update_table,
|
314 |
+
# [
|
315 |
+
# hidden_leaderboard_table_for_search,
|
316 |
+
# leaderboard_table,
|
317 |
+
# shown_columns,
|
318 |
+
# filter_columns_type,
|
319 |
+
# filter_columns_precision,
|
320 |
+
# filter_columns_size,
|
321 |
+
# deleted_models_visibility,
|
322 |
+
# search_bar,
|
323 |
+
# ],
|
324 |
+
# leaderboard_table,
|
325 |
+
# queue=True,
|
326 |
+
# )
|
327 |
+
# filter_columns_size.change(
|
328 |
+
# update_table,
|
329 |
+
# [
|
330 |
+
# hidden_leaderboard_table_for_search,
|
331 |
+
# leaderboard_table,
|
332 |
+
# shown_columns,
|
333 |
+
# filter_columns_type,
|
334 |
+
# filter_columns_precision,
|
335 |
+
# filter_columns_size,
|
336 |
+
# deleted_models_visibility,
|
337 |
+
# search_bar,
|
338 |
+
# ],
|
339 |
+
# leaderboard_table,
|
340 |
+
# queue=True,
|
341 |
+
# )
|
342 |
+
# deleted_models_visibility.change(
|
343 |
+
# update_table,
|
344 |
+
# [
|
345 |
+
# hidden_leaderboard_table_for_search,
|
346 |
+
# leaderboard_table,
|
347 |
+
# shown_columns,
|
348 |
+
# filter_columns_type,
|
349 |
+
# filter_columns_precision,
|
350 |
+
# filter_columns_size,
|
351 |
+
# deleted_models_visibility,
|
352 |
+
# search_bar,
|
353 |
+
# ],
|
354 |
+
# leaderboard_table,
|
355 |
+
# queue=True,
|
356 |
+
# )
|
357 |
+
# with gr.TabItem("📝 About", elem_id="llm-benchmark-tab-table", id=2):
|
358 |
+
# gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
359 |
+
#
|
360 |
+
# with gr.TabItem("🚀 Submit here! ", elem_id="llm-benchmark-tab-table", id=3):
|
361 |
+
# with gr.Column():
|
362 |
+
# with gr.Row():
|
363 |
+
# gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
|
364 |
+
#
|
365 |
+
# with gr.Column():
|
366 |
+
# with gr.Accordion(
|
367 |
+
# f"✅ Finished Evaluations ({len(finished_eval_queue_df)})",
|
368 |
+
# open=False,
|
369 |
+
# ):
|
370 |
+
# with gr.Row():
|
371 |
+
# finished_eval_table = gr.components.Dataframe(
|
372 |
+
# value=finished_eval_queue_df,
|
373 |
+
# headers=EVAL_COLS,
|
374 |
+
# datatype=EVAL_TYPES,
|
375 |
+
# max_rows=5,
|
376 |
+
# )
|
377 |
+
# with gr.Accordion(
|
378 |
+
# f"🔄 Running Evaluation Queue ({len(running_eval_queue_df)})",
|
379 |
+
# open=False,
|
380 |
+
# ):
|
381 |
+
# with gr.Row():
|
382 |
+
# running_eval_table = gr.components.Dataframe(
|
383 |
+
# value=running_eval_queue_df,
|
384 |
+
# headers=EVAL_COLS,
|
385 |
+
# datatype=EVAL_TYPES,
|
386 |
+
# max_rows=5,
|
387 |
+
# )
|
388 |
+
#
|
389 |
+
# with gr.Accordion(
|
390 |
+
# f"⏳ Pending Evaluation Queue ({len(pending_eval_queue_df)})",
|
391 |
+
# open=False,
|
392 |
+
# ):
|
393 |
+
# with gr.Row():
|
394 |
+
# pending_eval_table = gr.components.Dataframe(
|
395 |
+
# value=pending_eval_queue_df,
|
396 |
+
# headers=EVAL_COLS,
|
397 |
+
# datatype=EVAL_TYPES,
|
398 |
+
# max_rows=5,
|
399 |
+
# )
|
400 |
+
# with gr.Row():
|
401 |
+
# gr.Markdown("# ✉️✨ Submit your model here!", elem_classes="markdown-text")
|
402 |
+
#
|
403 |
+
# with gr.Row():
|
404 |
+
# with gr.Column():
|
405 |
+
# model_name_textbox = gr.Textbox(label="Model name")
|
406 |
+
# revision_name_textbox = gr.Textbox(label="revision", placeholder="main")
|
407 |
+
# private = gr.Checkbox(False, label="Private", visible=not IS_PUBLIC)
|
408 |
+
# model_type = gr.Dropdown(
|
409 |
+
# choices=[
|
410 |
+
# ModelType.PT.to_str(" : "),
|
411 |
+
# ModelType.FT.to_str(" : "),
|
412 |
+
# ModelType.IFT.to_str(" : "),
|
413 |
+
# ModelType.RL.to_str(" : "),
|
414 |
+
# ],
|
415 |
+
# label="Model type",
|
416 |
+
# multiselect=False,
|
417 |
+
# value=None,
|
418 |
+
# interactive=True,
|
419 |
+
# )
|
420 |
+
#
|
421 |
+
# with gr.Column():
|
422 |
+
# precision = gr.Dropdown(
|
423 |
+
# choices=[
|
424 |
+
# "float16",
|
425 |
+
# "bfloat16",
|
426 |
+
# "8bit (LLM.int8)",
|
427 |
+
# "4bit (QLoRA / FP4)",
|
428 |
+
# "GPTQ"
|
429 |
+
# ],
|
430 |
+
# label="Precision",
|
431 |
+
# multiselect=False,
|
432 |
+
# value="float16",
|
433 |
+
# interactive=True,
|
434 |
+
# )
|
435 |
+
# weight_type = gr.Dropdown(
|
436 |
+
# choices=["Original", "Delta", "Adapter"],
|
437 |
+
# label="Weights type",
|
438 |
+
# multiselect=False,
|
439 |
+
# value="Original",
|
440 |
+
# interactive=True,
|
441 |
+
# )
|
442 |
+
# base_model_name_textbox = gr.Textbox(label="Base model (for delta or adapter weights)")
|
443 |
+
#
|
444 |
+
# submit_button = gr.Button("Submit Eval")
|
445 |
+
# submission_result = gr.Markdown()
|
446 |
+
# submit_button.click(
|
447 |
+
# add_new_eval,
|
448 |
+
# [
|
449 |
+
# model_name_textbox,
|
450 |
+
# base_model_name_textbox,
|
451 |
+
# revision_name_textbox,
|
452 |
+
# precision,
|
453 |
+
# private,
|
454 |
+
# weight_type,
|
455 |
+
# model_type,
|
456 |
+
# ],
|
457 |
+
# submission_result,
|
458 |
+
# )
|
459 |
+
#
|
460 |
+
# with gr.Row():
|
461 |
+
# with gr.Accordion("📙 Citation", open=False):
|
462 |
+
# citation_button = gr.Textbox(
|
463 |
+
# value=CITATION_BUTTON_TEXT,
|
464 |
+
# label=CITATION_BUTTON_LABEL,
|
465 |
+
# elem_id="citation-button",
|
466 |
+
# ).style(show_copy_button=True)
|
467 |
+
#
|
468 |
+
# dummy = gr.Textbox(visible=False)
|
469 |
+
# demo.load(
|
470 |
+
# change_tab,
|
471 |
+
# dummy,
|
472 |
+
# tabs,
|
473 |
+
# _js=get_window_url_params,
|
474 |
+
# )
|
475 |
+
|
476 |
+
dummy1 = gr.Textbox(visible=False)
|
477 |
+
|
478 |
+
hidden_leaderboard_table_for_search = gr.components.Dataframe(
|
479 |
+
headers=COLS,
|
480 |
+
datatype=TYPES,
|
481 |
+
max_rows=None,
|
482 |
+
visible=False,
|
483 |
+
)
|
484 |
|
485 |
+
def display(x, y):
|
486 |
+
return original_df
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
487 |
|
488 |
+
INTRODUCTION_TEXT = """
|
489 |
+
This is a copied space from Open Source LLM leaderboard. Instead of displaying
|
490 |
+
the results as table the space simply provides a gradio API interface to access
|
491 |
+
the full leaderboard data easily.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
|
493 |
+
Example python on how to access the data:
|
494 |
+
```python
|
495 |
+
from gradio_client import Client
|
496 |
+
import json
|
497 |
+
client = Client("https://felixz-open-llm-leaderboard.hf.space/")
|
|
|
|
|
|
|
|
|
498 |
|
499 |
+
json_data = client.predict("","", api_name='/predict')
|
500 |
+
|
501 |
+
with open(json_data, 'r') as file:
|
502 |
+
file_data = file.read()
|
503 |
+
|
504 |
+
# Load the JSON data
|
505 |
+
data = json.loads(file_data)
|
506 |
+
|
507 |
+
# Get the headers and the data
|
508 |
+
headers = data['headers']
|
509 |
+
data = data['data']
|
510 |
+
```
|
511 |
+
|
512 |
+
"""
|
513 |
+
|
514 |
+
interface = gr.Interface(
|
515 |
+
fn=display,
|
516 |
+
inputs=[ gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text"),
|
517 |
+
dummy1
|
518 |
+
],
|
519 |
+
outputs=[hidden_leaderboard_table_for_search]
|
520 |
+
)
|
521 |
+
|
522 |
+
#scheduler = BackgroundScheduler()
|
523 |
+
#scheduler.add_job(restart_space, "interval", seconds=12000)
|
524 |
+
#scheduler.start()
|
525 |
|
526 |
+
interface.launch()
|
527 |
+
#demo.queue(concurrency_count=40).launch()
|
|
|
|