Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
feat: add noreranker tabs to long-doc
Browse files
app.py
CHANGED
|
@@ -196,20 +196,7 @@ with demo:
|
|
| 196 |
|
| 197 |
with gr.TabItem("Long Doc", elem_id="long-doc-benchmark-tab-table", id=1):
|
| 198 |
with gr.Row():
|
| 199 |
-
with gr.Column():
|
| 200 |
-
with gr.Row():
|
| 201 |
-
selected_version = get_version_dropdown()
|
| 202 |
-
with gr.Row():
|
| 203 |
-
search_bar = get_search_bar()
|
| 204 |
-
# select reranking model
|
| 205 |
-
with gr.Row():
|
| 206 |
-
selected_rerankings = get_reranking_dropdown(reranking_models)
|
| 207 |
-
with gr.Row():
|
| 208 |
-
select_noreranker_only_btn = get_noreranker_button()
|
| 209 |
with gr.Column(min_width=320):
|
| 210 |
-
# select the metric
|
| 211 |
-
with gr.Row():
|
| 212 |
-
selected_metric = get_metric_dropdown(METRIC_LIST, DEFAULT_METRIC)
|
| 213 |
# select domain
|
| 214 |
with gr.Row():
|
| 215 |
selected_domains = get_domain_dropdown(DOMAIN_COLS_LONG_DOC, DOMAIN_COLS_LONG_DOC)
|
|
@@ -218,47 +205,106 @@ with demo:
|
|
| 218 |
selected_langs = get_language_dropdown(
|
| 219 |
LANG_COLS_LONG_DOC, LANG_COLS_LONG_DOC
|
| 220 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
with gr.Row():
|
| 222 |
show_anonymous = get_anonymous_checkbox()
|
| 223 |
with gr.Row():
|
| 224 |
show_revision_and_timestamp = get_revision_and_ts_checkbox()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
|
| 263 |
with gr.TabItem("🚀Submit here!", elem_id="submit-tab-table", id=2):
|
| 264 |
with gr.Column():
|
|
|
|
| 196 |
|
| 197 |
with gr.TabItem("Long Doc", elem_id="long-doc-benchmark-tab-table", id=1):
|
| 198 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
with gr.Column(min_width=320):
|
|
|
|
|
|
|
|
|
|
| 200 |
# select domain
|
| 201 |
with gr.Row():
|
| 202 |
selected_domains = get_domain_dropdown(DOMAIN_COLS_LONG_DOC, DOMAIN_COLS_LONG_DOC)
|
|
|
|
| 205 |
selected_langs = get_language_dropdown(
|
| 206 |
LANG_COLS_LONG_DOC, LANG_COLS_LONG_DOC
|
| 207 |
)
|
| 208 |
+
with gr.Column():
|
| 209 |
+
with gr.Row():
|
| 210 |
+
selected_version = get_version_dropdown()
|
| 211 |
+
# select the metric
|
| 212 |
+
with gr.Row():
|
| 213 |
+
selected_metric = get_metric_dropdown(METRIC_LIST, DEFAULT_METRIC)
|
| 214 |
with gr.Row():
|
| 215 |
show_anonymous = get_anonymous_checkbox()
|
| 216 |
with gr.Row():
|
| 217 |
show_revision_and_timestamp = get_revision_and_ts_checkbox()
|
| 218 |
+
with gr.Tabs(elem_classes="tab-buttons") as sub_tabs:
|
| 219 |
+
with gr.TabItem("Retriever + Reranker", id=20):
|
| 220 |
+
with gr.Row():
|
| 221 |
+
with gr.Column():
|
| 222 |
+
search_bar = get_search_bar()
|
| 223 |
+
# select reranking model
|
| 224 |
+
with gr.Column():
|
| 225 |
+
selected_rerankings = get_reranking_dropdown(reranking_models)
|
| 226 |
+
|
| 227 |
+
lb_table = get_leaderboard_table(
|
| 228 |
+
leaderboard_df_long_doc, types_long_doc
|
| 229 |
+
)
|
| 230 |
+
|
| 231 |
+
# Dummy leaderboard for handling the case when the user uses backspace key
|
| 232 |
+
hidden_lb_table_for_search = get_leaderboard_table(
|
| 233 |
+
original_df_long_doc, types_long_doc, visible=False
|
| 234 |
+
)
|
| 235 |
+
|
| 236 |
+
set_listeners(
|
| 237 |
+
"long-doc",
|
| 238 |
+
lb_table,
|
| 239 |
+
hidden_lb_table_for_search,
|
| 240 |
+
search_bar,
|
| 241 |
+
selected_domains,
|
| 242 |
+
selected_langs,
|
| 243 |
+
selected_rerankings,
|
| 244 |
+
show_anonymous,
|
| 245 |
+
show_revision_and_timestamp,
|
| 246 |
+
)
|
| 247 |
+
|
| 248 |
+
# set metric listener
|
| 249 |
+
selected_metric.change(
|
| 250 |
+
update_metric_long_doc,
|
| 251 |
+
[
|
| 252 |
+
selected_metric,
|
| 253 |
+
selected_domains,
|
| 254 |
+
selected_langs,
|
| 255 |
+
selected_rerankings,
|
| 256 |
+
search_bar,
|
| 257 |
+
show_anonymous,
|
| 258 |
+
show_revision_and_timestamp
|
| 259 |
+
],
|
| 260 |
+
lb_table,
|
| 261 |
+
queue=True
|
| 262 |
+
)
|
| 263 |
|
| 264 |
+
with gr.TabItem("Retriever Only", id=21):
|
| 265 |
+
with gr.Column():
|
| 266 |
+
search_bar_retriever = get_search_bar()
|
| 267 |
+
selected_noreranker = get_noreranking_dropdown()
|
| 268 |
+
lb_df_retriever_long_doc = leaderboard_df_long_doc[
|
| 269 |
+
leaderboard_df_long_doc[COL_NAME_RERANKING_MODEL] == "NoReranker"
|
| 270 |
+
]
|
| 271 |
+
lb_df_retriever_long_doc = reset_rank(lb_df_retriever_long_doc)
|
| 272 |
+
hidden_lb_db_retriever_long_doc = original_df_long_doc[
|
| 273 |
+
original_df_long_doc[COL_NAME_RERANKING_MODEL] == "NoReranker"
|
| 274 |
+
]
|
| 275 |
+
hidden_lb_db_retriever_long_doc = reset_rank(hidden_lb_db_retriever_long_doc)
|
| 276 |
+
lb_table_retriever_long_doc = get_leaderboard_table(
|
| 277 |
+
lb_df_retriever_long_doc, types_long_doc)
|
| 278 |
+
hidden_lb_table_retriever_long_doc = get_leaderboard_table(
|
| 279 |
+
hidden_lb_db_retriever_long_doc, types_long_doc, visible=False
|
| 280 |
+
)
|
| 281 |
+
|
| 282 |
+
set_listeners(
|
| 283 |
+
"long-doc",
|
| 284 |
+
lb_table_retriever_long_doc,
|
| 285 |
+
hidden_lb_table_retriever_long_doc,
|
| 286 |
+
search_bar_retriever,
|
| 287 |
+
selected_domains,
|
| 288 |
+
selected_langs,
|
| 289 |
+
selected_noreranker,
|
| 290 |
+
show_anonymous,
|
| 291 |
+
show_revision_and_timestamp,
|
| 292 |
+
)
|
| 293 |
+
|
| 294 |
+
selected_metric.change(
|
| 295 |
+
update_metric_long_doc,
|
| 296 |
+
[
|
| 297 |
+
selected_metric,
|
| 298 |
+
selected_domains,
|
| 299 |
+
selected_langs,
|
| 300 |
+
selected_noreranker,
|
| 301 |
+
search_bar_retriever,
|
| 302 |
+
show_anonymous,
|
| 303 |
+
show_revision_and_timestamp,
|
| 304 |
+
],
|
| 305 |
+
lb_table_retriever_long_doc,
|
| 306 |
+
queue=True
|
| 307 |
+
)
|
| 308 |
|
| 309 |
with gr.TabItem("🚀Submit here!", elem_id="submit-tab-table", id=2):
|
| 310 |
with gr.Column():
|