Spaces:
Running
Running
clean
Browse files
app.py
CHANGED
|
@@ -1,11 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import pandas as pd
|
| 3 |
-
from src.populate import get_model_info_df, get_merged_df
|
| 4 |
|
| 5 |
from src.about import (
|
| 6 |
CITATION_BUTTON_LABEL,
|
| 7 |
CITATION_BUTTON_TEXT,
|
| 8 |
-
EVALUATION_QUEUE_TEXT,
|
| 9 |
INTRODUCTION_TEXT,
|
| 10 |
LLM_BENCHMARKS_TEXT,
|
| 11 |
TITLE,
|
|
@@ -14,50 +11,23 @@ from src.display.css_html_js import custom_css
|
|
| 14 |
from src.display.utils import (
|
| 15 |
BENCHMARK_COLS,
|
| 16 |
COLS,
|
| 17 |
-
EVAL_COLS,
|
| 18 |
-
EVAL_TYPES,
|
| 19 |
AutoEvalColumn,
|
| 20 |
-
ModelType,
|
| 21 |
fields,
|
| 22 |
-
WeightType,
|
| 23 |
-
Precision,
|
| 24 |
)
|
| 25 |
-
from src.envs import
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
|
| 30 |
def restart_space():
|
| 31 |
API.restart_space(repo_id=REPO_ID, token=TOKEN)
|
| 32 |
|
| 33 |
|
| 34 |
-
### Space initialisation
|
| 35 |
-
# try:
|
| 36 |
-
# print(EVAL_REQUESTS_PATH)
|
| 37 |
-
# snapshot_download(
|
| 38 |
-
# repo_id=QUEUE_REPO,
|
| 39 |
-
# local_dir=EVAL_REQUESTS_PATH,
|
| 40 |
-
# repo_type="dataset",
|
| 41 |
-
# tqdm_class=None,
|
| 42 |
-
# etag_timeout=30,
|
| 43 |
-
# token=TOKEN,
|
| 44 |
-
# )
|
| 45 |
-
# except Exception:
|
| 46 |
-
# restart_space()
|
| 47 |
-
# try:
|
| 48 |
-
# print(EVAL_RESULTS_PATH)
|
| 49 |
-
# snapshot_download(
|
| 50 |
-
# repo_id=RESULTS_REPO,
|
| 51 |
-
# local_dir=EVAL_RESULTS_PATH,
|
| 52 |
-
# repo_type="dataset",
|
| 53 |
-
# tqdm_class=None,
|
| 54 |
-
# etag_timeout=30,
|
| 55 |
-
# token=TOKEN,
|
| 56 |
-
# )
|
| 57 |
-
# except Exception:
|
| 58 |
-
# restart_space()
|
| 59 |
-
|
| 60 |
-
|
| 61 |
LEADERBOARD_DF = get_leaderboard_df(
|
| 62 |
EVAL_RESULTS_PATH + "/leaderboards/BOOM_leaderboard.csv", EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS
|
| 63 |
)
|
|
@@ -105,15 +75,15 @@ def init_leaderboard(dataframe, model_info_df):
|
|
| 105 |
]
|
| 106 |
)
|
| 107 |
merged_df = merged_df[cols]
|
| 108 |
-
|
| 109 |
# Remove hidden columns
|
| 110 |
hidden_cols = [c.name for c in fields(AutoEvalColumn) if c.hidden]
|
| 111 |
-
merged_df = merged_df.drop(columns=[col for col in hidden_cols if col in merged_df.columns], errors=
|
| 112 |
-
|
| 113 |
# Build datatype list
|
| 114 |
col2type_dict = {c.name: c.type for c in fields(AutoEvalColumn)}
|
| 115 |
datatype_list = [col2type_dict[col] if col in col2type_dict else "number" for col in merged_df.columns]
|
| 116 |
-
|
| 117 |
# Use native Gradio 6 Dataframe with search and filter
|
| 118 |
return gr.Dataframe(
|
| 119 |
value=merged_df,
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
|
| 3 |
from src.about import (
|
| 4 |
CITATION_BUTTON_LABEL,
|
| 5 |
CITATION_BUTTON_TEXT,
|
|
|
|
| 6 |
INTRODUCTION_TEXT,
|
| 7 |
LLM_BENCHMARKS_TEXT,
|
| 8 |
TITLE,
|
|
|
|
| 11 |
from src.display.utils import (
|
| 12 |
BENCHMARK_COLS,
|
| 13 |
COLS,
|
|
|
|
|
|
|
| 14 |
AutoEvalColumn,
|
|
|
|
| 15 |
fields,
|
|
|
|
|
|
|
| 16 |
)
|
| 17 |
+
from src.envs import (
|
| 18 |
+
API,
|
| 19 |
+
EVAL_REQUESTS_PATH,
|
| 20 |
+
EVAL_RESULTS_PATH,
|
| 21 |
+
REPO_ID,
|
| 22 |
+
TOKEN,
|
| 23 |
+
)
|
| 24 |
+
from src.populate import get_leaderboard_df, get_model_info_df, get_merged_df
|
| 25 |
|
| 26 |
|
| 27 |
def restart_space():
|
| 28 |
API.restart_space(repo_id=REPO_ID, token=TOKEN)
|
| 29 |
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
LEADERBOARD_DF = get_leaderboard_df(
|
| 32 |
EVAL_RESULTS_PATH + "/leaderboards/BOOM_leaderboard.csv", EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS
|
| 33 |
)
|
|
|
|
| 75 |
]
|
| 76 |
)
|
| 77 |
merged_df = merged_df[cols]
|
| 78 |
+
|
| 79 |
# Remove hidden columns
|
| 80 |
hidden_cols = [c.name for c in fields(AutoEvalColumn) if c.hidden]
|
| 81 |
+
merged_df = merged_df.drop(columns=[col for col in hidden_cols if col in merged_df.columns], errors="ignore")
|
| 82 |
+
|
| 83 |
# Build datatype list
|
| 84 |
col2type_dict = {c.name: c.type for c in fields(AutoEvalColumn)}
|
| 85 |
datatype_list = [col2type_dict[col] if col in col2type_dict else "number" for col in merged_df.columns]
|
| 86 |
+
|
| 87 |
# Use native Gradio 6 Dataframe with search and filter
|
| 88 |
return gr.Dataframe(
|
| 89 |
value=merged_df,
|