remove submit logic
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ from src.display.utils import (
|
|
24 |
ModelType,
|
25 |
fields,
|
26 |
WeightType,
|
27 |
-
Precision
|
28 |
)
|
29 |
from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKEN
|
30 |
from src.populate import get_evaluation_queue_df, get_leaderboard_df
|
@@ -34,17 +34,28 @@ from src.submission.submit import add_new_eval
|
|
34 |
def restart_space():
|
35 |
API.restart_space(repo_id=REPO_ID)
|
36 |
|
|
|
37 |
try:
|
38 |
print(EVAL_REQUESTS_PATH)
|
39 |
snapshot_download(
|
40 |
-
repo_id=QUEUE_REPO,
|
|
|
|
|
|
|
|
|
|
|
41 |
)
|
42 |
except Exception:
|
43 |
restart_space()
|
44 |
try:
|
45 |
print(EVAL_RESULTS_PATH)
|
46 |
snapshot_download(
|
47 |
-
repo_id=RESULTS_REPO,
|
|
|
|
|
|
|
|
|
|
|
48 |
)
|
49 |
except Exception:
|
50 |
restart_space()
|
@@ -53,11 +64,11 @@ except Exception:
|
|
53 |
raw_data, original_df = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
|
54 |
leaderboard_df = original_df.copy()
|
55 |
|
56 |
-
(
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
) = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
|
61 |
|
62 |
|
63 |
# Searching and filtering
|
@@ -86,9 +97,7 @@ def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
|
|
86 |
AutoEvalColumn.model.name,
|
87 |
]
|
88 |
# We use COLS to maintain sorting
|
89 |
-
filtered_df = df[
|
90 |
-
always_here_cols + [c for c in COLS if c in df.columns and c in columns]
|
91 |
-
]
|
92 |
return filtered_df
|
93 |
|
94 |
|
@@ -149,11 +158,7 @@ with demo:
|
|
149 |
)
|
150 |
with gr.Row():
|
151 |
shown_columns = gr.CheckboxGroup(
|
152 |
-
choices=[
|
153 |
-
c.name
|
154 |
-
for c in fields(AutoEvalColumn)
|
155 |
-
if not c.hidden and not c.never_hidden
|
156 |
-
],
|
157 |
value=[
|
158 |
c.name
|
159 |
for c in fields(AutoEvalColumn)
|
@@ -168,7 +173,7 @@ with demo:
|
|
168 |
value=False, label="Show gated/private/deleted models", interactive=True
|
169 |
)
|
170 |
with gr.Column(min_width=320):
|
171 |
-
#with gr.Box(elem_id="box-filter"):
|
172 |
filter_columns_type = gr.CheckboxGroup(
|
173 |
label="Model types",
|
174 |
choices=[t.to_str() for t in ModelType],
|
@@ -192,10 +197,7 @@ with demo:
|
|
192 |
)
|
193 |
|
194 |
leaderboard_table = gr.components.Dataframe(
|
195 |
-
value=leaderboard_df[
|
196 |
-
[c.name for c in fields(AutoEvalColumn) if c.never_hidden]
|
197 |
-
+ shown_columns.value
|
198 |
-
],
|
199 |
headers=[c.name for c in fields(AutoEvalColumn) if c.never_hidden] + shown_columns.value,
|
200 |
datatype=TYPES,
|
201 |
elem_id="leaderboard-table",
|
@@ -223,7 +225,13 @@ with demo:
|
|
223 |
],
|
224 |
leaderboard_table,
|
225 |
)
|
226 |
-
for selector in [
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
selector.change(
|
228 |
update_table,
|
229 |
[
|
@@ -242,92 +250,92 @@ with demo:
|
|
242 |
with gr.TabItem("π About", elem_id="llm-benchmark-tab-table", id=2):
|
243 |
gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
244 |
|
245 |
-
with gr.TabItem("π Submit here! ", elem_id="llm-benchmark-tab-table", id=3):
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
|
332 |
with gr.Row():
|
333 |
with gr.Accordion("π Citation", open=False):
|
@@ -342,4 +350,4 @@ with demo:
|
|
342 |
scheduler = BackgroundScheduler()
|
343 |
scheduler.add_job(restart_space, "interval", seconds=1800)
|
344 |
scheduler.start()
|
345 |
-
demo.queue(default_concurrency_limit=40).launch()
|
|
|
24 |
ModelType,
|
25 |
fields,
|
26 |
WeightType,
|
27 |
+
Precision,
|
28 |
)
|
29 |
from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKEN
|
30 |
from src.populate import get_evaluation_queue_df, get_leaderboard_df
|
|
|
34 |
def restart_space():
|
35 |
API.restart_space(repo_id=REPO_ID)
|
36 |
|
37 |
+
|
38 |
try:
|
39 |
print(EVAL_REQUESTS_PATH)
|
40 |
snapshot_download(
|
41 |
+
repo_id=QUEUE_REPO,
|
42 |
+
local_dir=EVAL_REQUESTS_PATH,
|
43 |
+
repo_type="dataset",
|
44 |
+
tqdm_class=None,
|
45 |
+
etag_timeout=30,
|
46 |
+
token=TOKEN,
|
47 |
)
|
48 |
except Exception:
|
49 |
restart_space()
|
50 |
try:
|
51 |
print(EVAL_RESULTS_PATH)
|
52 |
snapshot_download(
|
53 |
+
repo_id=RESULTS_REPO,
|
54 |
+
local_dir=EVAL_RESULTS_PATH,
|
55 |
+
repo_type="dataset",
|
56 |
+
tqdm_class=None,
|
57 |
+
etag_timeout=30,
|
58 |
+
token=TOKEN,
|
59 |
)
|
60 |
except Exception:
|
61 |
restart_space()
|
|
|
64 |
raw_data, original_df = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
|
65 |
leaderboard_df = original_df.copy()
|
66 |
|
67 |
+
# (
|
68 |
+
# finished_eval_queue_df,
|
69 |
+
# running_eval_queue_df,
|
70 |
+
# pending_eval_queue_df,
|
71 |
+
# ) = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
|
72 |
|
73 |
|
74 |
# Searching and filtering
|
|
|
97 |
AutoEvalColumn.model.name,
|
98 |
]
|
99 |
# We use COLS to maintain sorting
|
100 |
+
filtered_df = df[always_here_cols + [c for c in COLS if c in df.columns and c in columns]]
|
|
|
|
|
101 |
return filtered_df
|
102 |
|
103 |
|
|
|
158 |
)
|
159 |
with gr.Row():
|
160 |
shown_columns = gr.CheckboxGroup(
|
161 |
+
choices=[c.name for c in fields(AutoEvalColumn) if not c.hidden and not c.never_hidden],
|
|
|
|
|
|
|
|
|
162 |
value=[
|
163 |
c.name
|
164 |
for c in fields(AutoEvalColumn)
|
|
|
173 |
value=False, label="Show gated/private/deleted models", interactive=True
|
174 |
)
|
175 |
with gr.Column(min_width=320):
|
176 |
+
# with gr.Box(elem_id="box-filter"):
|
177 |
filter_columns_type = gr.CheckboxGroup(
|
178 |
label="Model types",
|
179 |
choices=[t.to_str() for t in ModelType],
|
|
|
197 |
)
|
198 |
|
199 |
leaderboard_table = gr.components.Dataframe(
|
200 |
+
value=leaderboard_df[[c.name for c in fields(AutoEvalColumn) if c.never_hidden] + shown_columns.value],
|
|
|
|
|
|
|
201 |
headers=[c.name for c in fields(AutoEvalColumn) if c.never_hidden] + shown_columns.value,
|
202 |
datatype=TYPES,
|
203 |
elem_id="leaderboard-table",
|
|
|
225 |
],
|
226 |
leaderboard_table,
|
227 |
)
|
228 |
+
for selector in [
|
229 |
+
shown_columns,
|
230 |
+
filter_columns_type,
|
231 |
+
filter_columns_precision,
|
232 |
+
filter_columns_size,
|
233 |
+
deleted_models_visibility,
|
234 |
+
]:
|
235 |
selector.change(
|
236 |
update_table,
|
237 |
[
|
|
|
250 |
with gr.TabItem("π About", elem_id="llm-benchmark-tab-table", id=2):
|
251 |
gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
252 |
|
253 |
+
# with gr.TabItem("π Submit here! ", elem_id="llm-benchmark-tab-table", id=3):
|
254 |
+
# with gr.Column():
|
255 |
+
# with gr.Row():
|
256 |
+
# gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
|
257 |
+
|
258 |
+
# with gr.Column():
|
259 |
+
# with gr.Accordion(
|
260 |
+
# f"β
Finished Evaluations ({len(finished_eval_queue_df)})",
|
261 |
+
# open=False,
|
262 |
+
# ):
|
263 |
+
# with gr.Row():
|
264 |
+
# finished_eval_table = gr.components.Dataframe(
|
265 |
+
# value=finished_eval_queue_df,
|
266 |
+
# headers=EVAL_COLS,
|
267 |
+
# datatype=EVAL_TYPES,
|
268 |
+
# row_count=5,
|
269 |
+
# )
|
270 |
+
# with gr.Accordion(
|
271 |
+
# f"π Running Evaluation Queue ({len(running_eval_queue_df)})",
|
272 |
+
# open=False,
|
273 |
+
# ):
|
274 |
+
# with gr.Row():
|
275 |
+
# running_eval_table = gr.components.Dataframe(
|
276 |
+
# value=running_eval_queue_df,
|
277 |
+
# headers=EVAL_COLS,
|
278 |
+
# datatype=EVAL_TYPES,
|
279 |
+
# row_count=5,
|
280 |
+
# )
|
281 |
+
|
282 |
+
# with gr.Accordion(
|
283 |
+
# f"β³ Pending Evaluation Queue ({len(pending_eval_queue_df)})",
|
284 |
+
# open=False,
|
285 |
+
# ):
|
286 |
+
# with gr.Row():
|
287 |
+
# pending_eval_table = gr.components.Dataframe(
|
288 |
+
# value=pending_eval_queue_df,
|
289 |
+
# headers=EVAL_COLS,
|
290 |
+
# datatype=EVAL_TYPES,
|
291 |
+
# row_count=5,
|
292 |
+
# )
|
293 |
+
# with gr.Row():
|
294 |
+
# gr.Markdown("# βοΈβ¨ Submit your model here!", elem_classes="markdown-text")
|
295 |
+
|
296 |
+
# with gr.Row():
|
297 |
+
# with gr.Column():
|
298 |
+
# model_name_textbox = gr.Textbox(label="Model name")
|
299 |
+
# revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
|
300 |
+
# model_type = gr.Dropdown(
|
301 |
+
# choices=[t.to_str(" : ") for t in ModelType if t != ModelType.Unknown],
|
302 |
+
# label="Model type",
|
303 |
+
# multiselect=False,
|
304 |
+
# value=None,
|
305 |
+
# interactive=True,
|
306 |
+
# )
|
307 |
+
|
308 |
+
# with gr.Column():
|
309 |
+
# precision = gr.Dropdown(
|
310 |
+
# choices=[i.value.name for i in Precision if i != Precision.Unknown],
|
311 |
+
# label="Precision",
|
312 |
+
# multiselect=False,
|
313 |
+
# value="float16",
|
314 |
+
# interactive=True,
|
315 |
+
# )
|
316 |
+
# weight_type = gr.Dropdown(
|
317 |
+
# choices=[i.value.name for i in WeightType],
|
318 |
+
# label="Weights type",
|
319 |
+
# multiselect=False,
|
320 |
+
# value="Original",
|
321 |
+
# interactive=True,
|
322 |
+
# )
|
323 |
+
# base_model_name_textbox = gr.Textbox(label="Base model (for delta or adapter weights)")
|
324 |
+
|
325 |
+
# submit_button = gr.Button("Submit Eval")
|
326 |
+
# submission_result = gr.Markdown()
|
327 |
+
# submit_button.click(
|
328 |
+
# add_new_eval,
|
329 |
+
# [
|
330 |
+
# model_name_textbox,
|
331 |
+
# base_model_name_textbox,
|
332 |
+
# revision_name_textbox,
|
333 |
+
# precision,
|
334 |
+
# weight_type,
|
335 |
+
# model_type,
|
336 |
+
# ],
|
337 |
+
# submission_result,
|
338 |
+
# )
|
339 |
|
340 |
with gr.Row():
|
341 |
with gr.Accordion("π Citation", open=False):
|
|
|
350 |
scheduler = BackgroundScheduler()
|
351 |
scheduler.add_job(restart_space, "interval", seconds=1800)
|
352 |
scheduler.start()
|
353 |
+
demo.queue(default_concurrency_limit=40).launch()
|