Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,29 +1,13 @@
|
|
1 |
-
import json
|
2 |
-
import os
|
3 |
-
from datetime import datetime, timezone
|
4 |
-
|
5 |
-
|
6 |
import gradio as gr
|
7 |
-
import numpy as np
|
8 |
import pandas as pd
|
9 |
-
from apscheduler.schedulers.background import BackgroundScheduler
|
10 |
-
from huggingface_hub import HfApi
|
11 |
-
from transformers import AutoConfig
|
12 |
|
13 |
-
from src.auto_leaderboard.get_model_metadata import apply_metadata
|
14 |
from src.assets.text_content import *
|
15 |
-
from src.
|
16 |
-
from src.assets.hardcoded_evals import gpt4_values, gpt35_values, baseline
|
17 |
-
from src.assets.css_html_js import custom_css, get_window_url_params
|
18 |
-
from src.utils_display import AutoEvalColumn, EvalQueueColumn, fields, styled_error, styled_warning, styled_message
|
19 |
-
from src.init import get_all_requested_models, load_all_info_from_hub
|
20 |
-
|
21 |
|
22 |
|
23 |
def get_leaderboard_df():
|
24 |
-
|
25 |
data = {
|
26 |
-
'Datasets': ['metrics','SOTA(FT)', 'SOTA(ZS)', 'FLAN-T5', '
|
27 |
'KQApro': ['Acc','93.85', '94.20', '37.27', '38.28', '38.01', '40.35', '47.93', '57.20'],
|
28 |
'LC-quad2': ['F1','33.10', '-', '30.14', '33.04', '33.77', '39.04', '42.76', '54.95'],
|
29 |
'WQSP': ['Acc','73.10', '62.98', '59.87', '67.68', '72.34', '79.60', '83.70', '90.45'],
|
@@ -38,16 +22,13 @@ def get_leaderboard_df():
|
|
38 |
return df
|
39 |
|
40 |
|
41 |
-
original_df = get_leaderboard_df()
|
42 |
-
leaderboard_df = original_df.copy()
|
43 |
-
|
44 |
def search_table(df, query):
|
45 |
-
|
46 |
-
return df
|
47 |
-
else:
|
48 |
-
return df[df.apply(lambda row: query.lower() in row.astype(str).lower(), axis=1).any()]
|
49 |
|
50 |
|
|
|
|
|
|
|
51 |
demo = gr.Blocks(css=custom_css)
|
52 |
with demo:
|
53 |
gr.HTML(TITLE)
|
@@ -61,7 +42,6 @@ with demo:
|
|
61 |
)
|
62 |
|
63 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
64 |
-
|
65 |
with gr.TabItem("π
LLM Benchmark", elem_id="llm-benchmark-tab-table", id=1):
|
66 |
leaderboard_table = gr.components.Dataframe(
|
67 |
value=leaderboard_df,
|
@@ -83,8 +63,6 @@ with demo:
|
|
83 |
with gr.TabItem("About", elem_id="llm-benchmark-tab-table", id=2):
|
84 |
gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
85 |
|
86 |
-
|
87 |
-
|
88 |
with gr.Row():
|
89 |
with gr.Accordion("π Citation", open=False):
|
90 |
citation_button = gr.Textbox(
|
@@ -93,6 +71,4 @@ with demo:
|
|
93 |
elem_id="citation-button",
|
94 |
).style(show_copy_button=True)
|
95 |
|
96 |
-
|
97 |
-
|
98 |
demo.queue(concurrency_count=40).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import pandas as pd
|
|
|
|
|
|
|
3 |
|
|
|
4 |
from src.assets.text_content import *
|
5 |
+
from src.assets.css_html_js import custom_css
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
|
8 |
def get_leaderboard_df():
|
|
|
9 |
data = {
|
10 |
+
'Datasets': ['metrics','SOTA(FT)', 'SOTA(ZS)', 'FLAN-T5-XXL', 'text-davinci-001', 'text-davinci-002', 'text-davinci-003', 'ChatGPT', 'GPT-4'],
|
11 |
'KQApro': ['Acc','93.85', '94.20', '37.27', '38.28', '38.01', '40.35', '47.93', '57.20'],
|
12 |
'LC-quad2': ['F1','33.10', '-', '30.14', '33.04', '33.77', '39.04', '42.76', '54.95'],
|
13 |
'WQSP': ['Acc','73.10', '62.98', '59.87', '67.68', '72.34', '79.60', '83.70', '90.45'],
|
|
|
22 |
return df
|
23 |
|
24 |
|
|
|
|
|
|
|
25 |
def search_table(df, query):
|
26 |
+
return df[df.apply(lambda row: row.astype(str).str.contains(query).any(), axis=1)]
|
|
|
|
|
|
|
27 |
|
28 |
|
29 |
+
original_df = get_leaderboard_df()
|
30 |
+
leaderboard_df = original_df.copy()
|
31 |
+
|
32 |
demo = gr.Blocks(css=custom_css)
|
33 |
with demo:
|
34 |
gr.HTML(TITLE)
|
|
|
42 |
)
|
43 |
|
44 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
|
|
45 |
with gr.TabItem("π
LLM Benchmark", elem_id="llm-benchmark-tab-table", id=1):
|
46 |
leaderboard_table = gr.components.Dataframe(
|
47 |
value=leaderboard_df,
|
|
|
63 |
with gr.TabItem("About", elem_id="llm-benchmark-tab-table", id=2):
|
64 |
gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
65 |
|
|
|
|
|
66 |
with gr.Row():
|
67 |
with gr.Accordion("π Citation", open=False):
|
68 |
citation_button = gr.Textbox(
|
|
|
71 |
elem_id="citation-button",
|
72 |
).style(show_copy_button=True)
|
73 |
|
|
|
|
|
74 |
demo.queue(concurrency_count=40).launch()
|