Spaces:
AIR-Bench
/
Running on CPU Upgrade

nan commited on
Commit
de0db29
1 Parent(s): ca1267e

feat: add the ranking only tab for long-doc

Browse files
Files changed (1) hide show
  1. app.py +54 -10
app.py CHANGED
@@ -108,7 +108,6 @@ with demo:
108
  show_anonymous = get_anonymous_checkbox()
109
  with gr.Row():
110
  show_revision_and_timestamp = get_revision_and_ts_checkbox()
111
-
112
  with gr.Tabs(elem_classes="tab-buttons") as sub_tabs:
113
  with gr.TabItem("Retrieval + Reranking", id=10):
114
  with gr.Row():
@@ -150,9 +149,11 @@ with demo:
150
  queue=True
151
  )
152
  with gr.TabItem("Retrieval Only", id=11):
153
- with gr.Column():
154
- search_bar_retriever = get_search_bar()
155
- selected_noreranker = get_noreranking_dropdown()
 
 
156
  lb_df_retriever = leaderboard_df_qa[leaderboard_df_qa[COL_NAME_RERANKING_MODEL] == "NoReranker"]
157
  lb_df_retriever = reset_rank(lb_df_retriever)
158
  lb_table_retriever = get_leaderboard_table(lb_df_retriever, types_qa)
@@ -251,7 +252,7 @@ with demo:
251
  with gr.Row():
252
  show_revision_and_timestamp = get_revision_and_ts_checkbox()
253
  with gr.Tabs(elem_classes="tab-buttons") as sub_tabs:
254
- with gr.TabItem("Retriever + Reranker", id=20):
255
  with gr.Row():
256
  with gr.Column():
257
  search_bar = get_search_bar()
@@ -295,11 +296,12 @@ with demo:
295
  lb_table,
296
  queue=True
297
  )
298
-
299
- with gr.TabItem("Retriever Only", id=21):
300
- with gr.Column():
301
- search_bar_retriever = get_search_bar()
302
- selected_noreranker = get_noreranking_dropdown()
 
303
  lb_df_retriever_long_doc = leaderboard_df_long_doc[
304
  leaderboard_df_long_doc[COL_NAME_RERANKING_MODEL] == "NoReranker"
305
  ]
@@ -340,6 +342,48 @@ with demo:
340
  lb_table_retriever_long_doc,
341
  queue=True
342
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
 
344
  with gr.TabItem("🚀Submit here!", elem_id="submit-tab-table", id=2):
345
  with gr.Column():
 
108
  show_anonymous = get_anonymous_checkbox()
109
  with gr.Row():
110
  show_revision_and_timestamp = get_revision_and_ts_checkbox()
 
111
  with gr.Tabs(elem_classes="tab-buttons") as sub_tabs:
112
  with gr.TabItem("Retrieval + Reranking", id=10):
113
  with gr.Row():
 
149
  queue=True
150
  )
151
  with gr.TabItem("Retrieval Only", id=11):
152
+ with gr.Row():
153
+ with gr.Column(scale=1):
154
+ search_bar_retriever = get_search_bar()
155
+ with gr.Column(scale=1):
156
+ selected_noreranker = get_noreranking_dropdown()
157
  lb_df_retriever = leaderboard_df_qa[leaderboard_df_qa[COL_NAME_RERANKING_MODEL] == "NoReranker"]
158
  lb_df_retriever = reset_rank(lb_df_retriever)
159
  lb_table_retriever = get_leaderboard_table(lb_df_retriever, types_qa)
 
252
  with gr.Row():
253
  show_revision_and_timestamp = get_revision_and_ts_checkbox()
254
  with gr.Tabs(elem_classes="tab-buttons") as sub_tabs:
255
+ with gr.TabItem("Retrieval + Reranking", id=20):
256
  with gr.Row():
257
  with gr.Column():
258
  search_bar = get_search_bar()
 
296
  lb_table,
297
  queue=True
298
  )
299
+ with gr.TabItem("Retrieval Only", id=21):
300
+ with gr.Row():
301
+ with gr.Column(scale=1):
302
+ search_bar_retriever = get_search_bar()
303
+ with gr.Column(scale=1):
304
+ selected_noreranker = get_noreranking_dropdown()
305
  lb_df_retriever_long_doc = leaderboard_df_long_doc[
306
  leaderboard_df_long_doc[COL_NAME_RERANKING_MODEL] == "NoReranker"
307
  ]
 
342
  lb_table_retriever_long_doc,
343
  queue=True
344
  )
345
+ with gr.TabItem("Reranking Only", id=22):
346
+ with gr.Row():
347
+ with gr.Column(scale=1):
348
+ selected_rerankings_reranker_ldoc = get_reranking_dropdown(reranking_models)
349
+ with gr.Column(scale=1):
350
+ search_bar_reranker_ldoc = gr.Textbox(show_label=False, visible=False)
351
+ lb_df_reranker_ldoc = leaderboard_df_long_doc[
352
+ leaderboard_df_long_doc[COL_NAME_RETRIEVAL_MODEL] == "BM25"
353
+ ]
354
+ lb_df_reranker_ldoc = reset_rank(lb_df_reranker_ldoc)
355
+ lb_table_reranker_ldoc = get_leaderboard_table(lb_df_reranker_ldoc, types_long_doc)
356
+ hidden_lb_df_reranker_ldoc = original_df_long_doc[original_df_long_doc[COL_NAME_RETRIEVAL_MODEL] == "BM25"]
357
+ hidden_lb_df_reranker_ldoc = reset_rank(hidden_lb_df_reranker_ldoc)
358
+ hidden_lb_table_reranker_ldoc = get_leaderboard_table(
359
+ hidden_lb_df_reranker_ldoc, types_long_doc, visible=False
360
+ )
361
+
362
+ set_listeners(
363
+ "long-doc",
364
+ lb_table_reranker_ldoc,
365
+ hidden_lb_table_reranker_ldoc,
366
+ search_bar_reranker_ldoc,
367
+ selected_domains,
368
+ selected_langs,
369
+ selected_rerankings_reranker_ldoc,
370
+ show_anonymous,
371
+ show_revision_and_timestamp,
372
+ )
373
+ selected_metric.change(
374
+ update_metric_long_doc,
375
+ [
376
+ selected_metric,
377
+ selected_domains,
378
+ selected_langs,
379
+ selected_rerankings_reranker_ldoc,
380
+ search_bar_reranker_ldoc,
381
+ show_anonymous,
382
+ show_revision_and_timestamp,
383
+ ],
384
+ lb_table_reranker_ldoc,
385
+ queue=True
386
+ )
387
 
388
  with gr.TabItem("🚀Submit here!", elem_id="submit-tab-table", id=2):
389
  with gr.Column():