g8a9 commited on
Commit
e3b6497
β€’
1 Parent(s): 08b45d4

remove submit logic

Browse files
Files changed (1) hide show
  1. app.py +117 -109
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, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
 
 
 
 
 
41
  )
42
  except Exception:
43
  restart_space()
44
  try:
45
  print(EVAL_RESULTS_PATH)
46
  snapshot_download(
47
- repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
 
 
 
 
 
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
- finished_eval_queue_df,
58
- running_eval_queue_df,
59
- pending_eval_queue_df,
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 [shown_columns, filter_columns_type, filter_columns_precision, filter_columns_size, deleted_models_visibility]:
 
 
 
 
 
 
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
- with gr.Column():
247
- with gr.Row():
248
- gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
249
-
250
- with gr.Column():
251
- with gr.Accordion(
252
- f"βœ… Finished Evaluations ({len(finished_eval_queue_df)})",
253
- open=False,
254
- ):
255
- with gr.Row():
256
- finished_eval_table = gr.components.Dataframe(
257
- value=finished_eval_queue_df,
258
- headers=EVAL_COLS,
259
- datatype=EVAL_TYPES,
260
- row_count=5,
261
- )
262
- with gr.Accordion(
263
- f"πŸ”„ Running Evaluation Queue ({len(running_eval_queue_df)})",
264
- open=False,
265
- ):
266
- with gr.Row():
267
- running_eval_table = gr.components.Dataframe(
268
- value=running_eval_queue_df,
269
- headers=EVAL_COLS,
270
- datatype=EVAL_TYPES,
271
- row_count=5,
272
- )
273
-
274
- with gr.Accordion(
275
- f"⏳ Pending Evaluation Queue ({len(pending_eval_queue_df)})",
276
- open=False,
277
- ):
278
- with gr.Row():
279
- pending_eval_table = gr.components.Dataframe(
280
- value=pending_eval_queue_df,
281
- headers=EVAL_COLS,
282
- datatype=EVAL_TYPES,
283
- row_count=5,
284
- )
285
- with gr.Row():
286
- gr.Markdown("# βœ‰οΈβœ¨ Submit your model here!", elem_classes="markdown-text")
287
-
288
- with gr.Row():
289
- with gr.Column():
290
- model_name_textbox = gr.Textbox(label="Model name")
291
- revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
292
- model_type = gr.Dropdown(
293
- choices=[t.to_str(" : ") for t in ModelType if t != ModelType.Unknown],
294
- label="Model type",
295
- multiselect=False,
296
- value=None,
297
- interactive=True,
298
- )
299
-
300
- with gr.Column():
301
- precision = gr.Dropdown(
302
- choices=[i.value.name for i in Precision if i != Precision.Unknown],
303
- label="Precision",
304
- multiselect=False,
305
- value="float16",
306
- interactive=True,
307
- )
308
- weight_type = gr.Dropdown(
309
- choices=[i.value.name for i in WeightType],
310
- label="Weights type",
311
- multiselect=False,
312
- value="Original",
313
- interactive=True,
314
- )
315
- base_model_name_textbox = gr.Textbox(label="Base model (for delta or adapter weights)")
316
-
317
- submit_button = gr.Button("Submit Eval")
318
- submission_result = gr.Markdown()
319
- submit_button.click(
320
- add_new_eval,
321
- [
322
- model_name_textbox,
323
- base_model_name_textbox,
324
- revision_name_textbox,
325
- precision,
326
- weight_type,
327
- model_type,
328
- ],
329
- submission_result,
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()