Spaces:
AIR-Bench
/
Running on CPU Upgrade

nan commited on
Commit
9002757
1 Parent(s): 240d9ce

feat-add-no-reranker-button-0515 (#5)

Browse files

- feat: implement the no reranking button (9b59e476277d9d7796ea9ade3579f3e4fac32554)
- feat: implement the no reranking button (fd21bf9057f3b18249b672e2eb84269ac63a1e7f)

Files changed (2) hide show
  1. app.py +23 -1
  2. src/utils.py +4 -0
app.py CHANGED
@@ -14,13 +14,14 @@ from src.display.css_html_js import custom_css
14
  from src.display.utils import COL_NAME_IS_ANONYMOUS, COL_NAME_REVISION, COL_NAME_TIMESTAMP
15
  from src.envs import API, EVAL_RESULTS_PATH, REPO_ID, RESULTS_REPO, TOKEN
16
  from src.read_evals import get_raw_eval_results, get_leaderboard_df
17
- from src.utils import update_table, update_metric, update_table_long_doc, upload_file, get_default_cols, submit_results
18
 
19
 
20
  def restart_space():
21
  API.restart_space(repo_id=REPO_ID)
22
 
23
 
 
24
  try:
25
  snapshot_download(
26
  repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30,
@@ -129,6 +130,12 @@ with demo:
129
  elem_id="reranking-select",
130
  interactive=True
131
  )
 
 
 
 
 
 
132
  with gr.Column(min_width=320):
133
  # select the metric
134
  selected_metric = gr.Dropdown(
@@ -248,6 +255,11 @@ with demo:
248
  queue=True
249
  )
250
 
 
 
 
 
 
251
  with gr.TabItem("Long Doc", elem_id="long-doc-benchmark-tab-table", id=1):
252
  with gr.Row():
253
  with gr.Column():
@@ -268,6 +280,11 @@ with demo:
268
  elem_id="reranking-select-long-doc",
269
  interactive=True
270
  )
 
 
 
 
 
271
  with gr.Column(min_width=320):
272
  # select the metric
273
  with gr.Row():
@@ -391,6 +408,11 @@ with demo:
391
  queue=True
392
  )
393
 
 
 
 
 
 
394
  with gr.TabItem("🚀Submit here!", elem_id="submit-tab-table", id=2):
395
  with gr.Column():
396
  with gr.Row():
 
14
  from src.display.utils import COL_NAME_IS_ANONYMOUS, COL_NAME_REVISION, COL_NAME_TIMESTAMP
15
  from src.envs import API, EVAL_RESULTS_PATH, REPO_ID, RESULTS_REPO, TOKEN
16
  from src.read_evals import get_raw_eval_results, get_leaderboard_df
17
+ from src.utils import update_table, update_metric, update_table_long_doc, upload_file, get_default_cols, submit_results, clear_reranking_selections
18
 
19
 
20
  def restart_space():
21
  API.restart_space(repo_id=REPO_ID)
22
 
23
 
24
+
25
  try:
26
  snapshot_download(
27
  repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30,
 
130
  elem_id="reranking-select",
131
  interactive=True
132
  )
133
+ with gr.Row():
134
+ select_noreranker_only_btn = gr.ClearButton(
135
+ selected_rerankings,
136
+ value="Only show results without ranking models",
137
+ )
138
+
139
  with gr.Column(min_width=320):
140
  # select the metric
141
  selected_metric = gr.Dropdown(
 
255
  queue=True
256
  )
257
 
258
+ select_noreranker_only_btn.click(
259
+ clear_reranking_selections,
260
+ outputs=selected_rerankings
261
+ )
262
+
263
  with gr.TabItem("Long Doc", elem_id="long-doc-benchmark-tab-table", id=1):
264
  with gr.Row():
265
  with gr.Column():
 
280
  elem_id="reranking-select-long-doc",
281
  interactive=True
282
  )
283
+ with gr.Row():
284
+ select_noreranker_only_btn = gr.ClearButton(
285
+ selected_rerankings,
286
+ value="Only show results without ranking models",
287
+ )
288
  with gr.Column(min_width=320):
289
  # select the metric
290
  with gr.Row():
 
408
  queue=True
409
  )
410
 
411
+ select_noreranker_only_btn.click(
412
+ clear_reranking_selections,
413
+ outputs=selected_rerankings
414
+ )
415
+
416
  with gr.TabItem("🚀Submit here!", elem_id="submit-tab-table", id=2):
417
  with gr.Column():
418
  with gr.Row():
src/utils.py CHANGED
@@ -325,3 +325,7 @@ def submit_results(
325
  return styled_message(
326
  f"Thanks for submission!\nSubmission revision: {revision}"
327
  )
 
 
 
 
 
325
  return styled_message(
326
  f"Thanks for submission!\nSubmission revision: {revision}"
327
  )
328
+
329
+
330
+ def clear_reranking_selections():
331
+ return ["NoReranker",]