Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
refactor: refactor the naming
Browse files
app.py
CHANGED
@@ -149,17 +149,17 @@ with demo:
|
|
149 |
with gr.Column(min_width=320):
|
150 |
# select domain
|
151 |
with gr.Row():
|
152 |
-
|
153 |
# select language
|
154 |
with gr.Row():
|
155 |
-
|
156 |
with gr.Column():
|
157 |
# select the metric
|
158 |
-
|
159 |
with gr.Row():
|
160 |
show_anonymous = get_anonymous_checkbox()
|
161 |
with gr.Row():
|
162 |
-
|
163 |
with gr.Tabs(elem_classes="tab-buttons") as sub_tabs:
|
164 |
with gr.TabItem("Retrieval + Reranking", id=10):
|
165 |
with gr.Row():
|
@@ -168,7 +168,7 @@ with demo:
|
|
168 |
search_bar = get_search_bar()
|
169 |
# select reranking models
|
170 |
with gr.Column():
|
171 |
-
|
172 |
# shown_table
|
173 |
lb_table = get_leaderboard_table(datastore.qa_fmt_df, datastore.qa_types)
|
174 |
# Dummy leaderboard for handling the case when the user uses backspace key
|
@@ -176,10 +176,8 @@ with demo:
|
|
176 |
|
177 |
version.change(
|
178 |
update_qa_version,
|
179 |
-
|
180 |
-
|
181 |
-
],
|
182 |
-
[selected_domains, selected_langs, selected_rerankings, lb_table, hidden_lb_table],
|
183 |
)
|
184 |
|
185 |
set_listeners(
|
@@ -188,25 +186,17 @@ with demo:
|
|
188 |
hidden_lb_table,
|
189 |
search_bar,
|
190 |
version,
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
show_anonymous,
|
195 |
-
|
196 |
)
|
197 |
|
198 |
# set metric listener
|
199 |
-
|
200 |
update_qa_metric,
|
201 |
-
[
|
202 |
-
selected_metric,
|
203 |
-
selected_domains,
|
204 |
-
selected_langs,
|
205 |
-
selected_rerankings,
|
206 |
-
search_bar,
|
207 |
-
show_anonymous,
|
208 |
-
show_revision_and_timestamp,
|
209 |
-
],
|
210 |
lb_table,
|
211 |
queue=True,
|
212 |
)
|
@@ -239,8 +229,8 @@ with demo:
|
|
239 |
version,
|
240 |
],
|
241 |
[
|
242 |
-
|
243 |
-
|
244 |
selected_noreranker,
|
245 |
lb_table_retriever,
|
246 |
hidden_lb_table_retriever,
|
@@ -253,24 +243,24 @@ with demo:
|
|
253 |
hidden_lb_table_retriever,
|
254 |
search_bar_retriever,
|
255 |
version,
|
256 |
-
|
257 |
-
|
258 |
selected_noreranker,
|
259 |
show_anonymous,
|
260 |
-
|
261 |
)
|
262 |
|
263 |
# set metric listener
|
264 |
-
|
265 |
update_qa_metric,
|
266 |
[
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
selected_noreranker,
|
271 |
search_bar_retriever,
|
272 |
show_anonymous,
|
273 |
-
|
274 |
],
|
275 |
lb_table_retriever,
|
276 |
queue=True,
|
@@ -304,8 +294,8 @@ with demo:
|
|
304 |
version,
|
305 |
],
|
306 |
[
|
307 |
-
|
308 |
-
|
309 |
selected_rerankings_reranker,
|
310 |
lb_table_reranker,
|
311 |
hidden_lb_table_reranker,
|
@@ -318,23 +308,23 @@ with demo:
|
|
318 |
hidden_lb_table_reranker,
|
319 |
search_bar_reranker,
|
320 |
version,
|
321 |
-
|
322 |
-
|
323 |
selected_rerankings_reranker,
|
324 |
show_anonymous,
|
325 |
-
|
326 |
)
|
327 |
# set metric listener
|
328 |
-
|
329 |
update_qa_metric,
|
330 |
[
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
selected_rerankings_reranker,
|
335 |
search_bar_reranker,
|
336 |
show_anonymous,
|
337 |
-
|
338 |
],
|
339 |
lb_table_reranker,
|
340 |
queue=True,
|
@@ -344,25 +334,25 @@ with demo:
|
|
344 |
with gr.Column(min_width=320):
|
345 |
# select domain
|
346 |
with gr.Row():
|
347 |
-
|
348 |
# select language
|
349 |
with gr.Row():
|
350 |
-
|
351 |
with gr.Column():
|
352 |
# select the metric
|
353 |
with gr.Row():
|
354 |
-
|
355 |
with gr.Row():
|
356 |
show_anonymous = get_anonymous_checkbox()
|
357 |
with gr.Row():
|
358 |
-
|
359 |
with gr.Tabs(elem_classes="tab-buttons"):
|
360 |
with gr.TabItem("Retrieval + Reranking", id=20):
|
361 |
with gr.Row():
|
362 |
with gr.Column():
|
363 |
search_bar = get_search_bar()
|
364 |
with gr.Column():
|
365 |
-
|
366 |
|
367 |
lb_table_long_doc = get_leaderboard_table(
|
368 |
datastore.doc_fmt_df, datastore.doc_types
|
@@ -379,9 +369,9 @@ with demo:
|
|
379 |
version,
|
380 |
],
|
381 |
[
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
lb_table_long_doc,
|
386 |
hidden_lb_table_long_doc,
|
387 |
],
|
@@ -393,24 +383,24 @@ with demo:
|
|
393 |
hidden_lb_table_long_doc,
|
394 |
search_bar,
|
395 |
version,
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
show_anonymous,
|
400 |
-
|
401 |
)
|
402 |
|
403 |
# set metric listener
|
404 |
-
|
405 |
update_doc_metric,
|
406 |
[
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
search_bar,
|
412 |
show_anonymous,
|
413 |
-
|
414 |
],
|
415 |
lb_table_long_doc,
|
416 |
queue=True,
|
@@ -443,8 +433,8 @@ with demo:
|
|
443 |
version,
|
444 |
],
|
445 |
[
|
446 |
-
|
447 |
-
|
448 |
selected_noreranker,
|
449 |
lb_table_retriever_long_doc,
|
450 |
hidden_lb_table_retriever_long_doc,
|
@@ -457,23 +447,23 @@ with demo:
|
|
457 |
hidden_lb_table_retriever_long_doc,
|
458 |
search_bar_retriever,
|
459 |
version,
|
460 |
-
|
461 |
-
|
462 |
selected_noreranker,
|
463 |
show_anonymous,
|
464 |
-
|
465 |
)
|
466 |
|
467 |
-
|
468 |
update_doc_metric,
|
469 |
[
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
selected_noreranker,
|
474 |
search_bar_retriever,
|
475 |
show_anonymous,
|
476 |
-
|
477 |
],
|
478 |
lb_table_retriever_long_doc,
|
479 |
queue=True,
|
@@ -508,8 +498,8 @@ with demo:
|
|
508 |
version,
|
509 |
],
|
510 |
[
|
511 |
-
|
512 |
-
|
513 |
selected_rerankings_reranker_ldoc,
|
514 |
lb_table_reranker_ldoc,
|
515 |
hidden_lb_table_reranker_ldoc,
|
@@ -522,22 +512,22 @@ with demo:
|
|
522 |
hidden_lb_table_reranker_ldoc,
|
523 |
search_bar_reranker_ldoc,
|
524 |
version,
|
525 |
-
|
526 |
-
|
527 |
selected_rerankings_reranker_ldoc,
|
528 |
show_anonymous,
|
529 |
-
|
530 |
)
|
531 |
-
|
532 |
update_doc_metric,
|
533 |
[
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
selected_rerankings_reranker_ldoc,
|
538 |
search_bar_reranker_ldoc,
|
539 |
show_anonymous,
|
540 |
-
|
541 |
],
|
542 |
lb_table_reranker_ldoc,
|
543 |
queue=True,
|
|
|
149 |
with gr.Column(min_width=320):
|
150 |
# select domain
|
151 |
with gr.Row():
|
152 |
+
domains = get_domain_dropdown(QABenchmarks[datastore.slug])
|
153 |
# select language
|
154 |
with gr.Row():
|
155 |
+
langs = get_language_dropdown(QABenchmarks[datastore.slug])
|
156 |
with gr.Column():
|
157 |
# select the metric
|
158 |
+
metric = get_metric_dropdown(METRIC_LIST, DEFAULT_METRIC_QA)
|
159 |
with gr.Row():
|
160 |
show_anonymous = get_anonymous_checkbox()
|
161 |
with gr.Row():
|
162 |
+
show_rev_ts = get_revision_and_ts_checkbox()
|
163 |
with gr.Tabs(elem_classes="tab-buttons") as sub_tabs:
|
164 |
with gr.TabItem("Retrieval + Reranking", id=10):
|
165 |
with gr.Row():
|
|
|
168 |
search_bar = get_search_bar()
|
169 |
# select reranking models
|
170 |
with gr.Column():
|
171 |
+
models = get_reranking_dropdown(datastore.reranking_models)
|
172 |
# shown_table
|
173 |
lb_table = get_leaderboard_table(datastore.qa_fmt_df, datastore.qa_types)
|
174 |
# Dummy leaderboard for handling the case when the user uses backspace key
|
|
|
176 |
|
177 |
version.change(
|
178 |
update_qa_version,
|
179 |
+
version,
|
180 |
+
[domains, langs, models, lb_table, hidden_lb_table],
|
|
|
|
|
181 |
)
|
182 |
|
183 |
set_listeners(
|
|
|
186 |
hidden_lb_table,
|
187 |
search_bar,
|
188 |
version,
|
189 |
+
domains,
|
190 |
+
langs,
|
191 |
+
models,
|
192 |
show_anonymous,
|
193 |
+
show_rev_ts,
|
194 |
)
|
195 |
|
196 |
# set metric listener
|
197 |
+
metric.change(
|
198 |
update_qa_metric,
|
199 |
+
[metric, domains, langs, models, search_bar, show_anonymous, show_rev_ts],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
lb_table,
|
201 |
queue=True,
|
202 |
)
|
|
|
229 |
version,
|
230 |
],
|
231 |
[
|
232 |
+
domains,
|
233 |
+
langs,
|
234 |
selected_noreranker,
|
235 |
lb_table_retriever,
|
236 |
hidden_lb_table_retriever,
|
|
|
243 |
hidden_lb_table_retriever,
|
244 |
search_bar_retriever,
|
245 |
version,
|
246 |
+
domains,
|
247 |
+
langs,
|
248 |
selected_noreranker,
|
249 |
show_anonymous,
|
250 |
+
show_rev_ts,
|
251 |
)
|
252 |
|
253 |
# set metric listener
|
254 |
+
metric.change(
|
255 |
update_qa_metric,
|
256 |
[
|
257 |
+
metric,
|
258 |
+
domains,
|
259 |
+
langs,
|
260 |
selected_noreranker,
|
261 |
search_bar_retriever,
|
262 |
show_anonymous,
|
263 |
+
show_rev_ts,
|
264 |
],
|
265 |
lb_table_retriever,
|
266 |
queue=True,
|
|
|
294 |
version,
|
295 |
],
|
296 |
[
|
297 |
+
domains,
|
298 |
+
langs,
|
299 |
selected_rerankings_reranker,
|
300 |
lb_table_reranker,
|
301 |
hidden_lb_table_reranker,
|
|
|
308 |
hidden_lb_table_reranker,
|
309 |
search_bar_reranker,
|
310 |
version,
|
311 |
+
domains,
|
312 |
+
langs,
|
313 |
selected_rerankings_reranker,
|
314 |
show_anonymous,
|
315 |
+
show_rev_ts,
|
316 |
)
|
317 |
# set metric listener
|
318 |
+
metric.change(
|
319 |
update_qa_metric,
|
320 |
[
|
321 |
+
metric,
|
322 |
+
domains,
|
323 |
+
langs,
|
324 |
selected_rerankings_reranker,
|
325 |
search_bar_reranker,
|
326 |
show_anonymous,
|
327 |
+
show_rev_ts,
|
328 |
],
|
329 |
lb_table_reranker,
|
330 |
queue=True,
|
|
|
334 |
with gr.Column(min_width=320):
|
335 |
# select domain
|
336 |
with gr.Row():
|
337 |
+
domains = get_domain_dropdown(LongDocBenchmarks[datastore.slug])
|
338 |
# select language
|
339 |
with gr.Row():
|
340 |
+
langs = get_language_dropdown(LongDocBenchmarks[datastore.slug])
|
341 |
with gr.Column():
|
342 |
# select the metric
|
343 |
with gr.Row():
|
344 |
+
metric = get_metric_dropdown(METRIC_LIST, DEFAULT_METRIC_LONG_DOC)
|
345 |
with gr.Row():
|
346 |
show_anonymous = get_anonymous_checkbox()
|
347 |
with gr.Row():
|
348 |
+
show_rev_ts = get_revision_and_ts_checkbox()
|
349 |
with gr.Tabs(elem_classes="tab-buttons"):
|
350 |
with gr.TabItem("Retrieval + Reranking", id=20):
|
351 |
with gr.Row():
|
352 |
with gr.Column():
|
353 |
search_bar = get_search_bar()
|
354 |
with gr.Column():
|
355 |
+
models = get_reranking_dropdown(datastore.reranking_models)
|
356 |
|
357 |
lb_table_long_doc = get_leaderboard_table(
|
358 |
datastore.doc_fmt_df, datastore.doc_types
|
|
|
369 |
version,
|
370 |
],
|
371 |
[
|
372 |
+
domains,
|
373 |
+
langs,
|
374 |
+
models,
|
375 |
lb_table_long_doc,
|
376 |
hidden_lb_table_long_doc,
|
377 |
],
|
|
|
383 |
hidden_lb_table_long_doc,
|
384 |
search_bar,
|
385 |
version,
|
386 |
+
domains,
|
387 |
+
langs,
|
388 |
+
models,
|
389 |
show_anonymous,
|
390 |
+
show_rev_ts,
|
391 |
)
|
392 |
|
393 |
# set metric listener
|
394 |
+
metric.change(
|
395 |
update_doc_metric,
|
396 |
[
|
397 |
+
metric,
|
398 |
+
domains,
|
399 |
+
langs,
|
400 |
+
models,
|
401 |
search_bar,
|
402 |
show_anonymous,
|
403 |
+
show_rev_ts,
|
404 |
],
|
405 |
lb_table_long_doc,
|
406 |
queue=True,
|
|
|
433 |
version,
|
434 |
],
|
435 |
[
|
436 |
+
domains,
|
437 |
+
langs,
|
438 |
selected_noreranker,
|
439 |
lb_table_retriever_long_doc,
|
440 |
hidden_lb_table_retriever_long_doc,
|
|
|
447 |
hidden_lb_table_retriever_long_doc,
|
448 |
search_bar_retriever,
|
449 |
version,
|
450 |
+
domains,
|
451 |
+
langs,
|
452 |
selected_noreranker,
|
453 |
show_anonymous,
|
454 |
+
show_rev_ts,
|
455 |
)
|
456 |
|
457 |
+
metric.change(
|
458 |
update_doc_metric,
|
459 |
[
|
460 |
+
metric,
|
461 |
+
domains,
|
462 |
+
langs,
|
463 |
selected_noreranker,
|
464 |
search_bar_retriever,
|
465 |
show_anonymous,
|
466 |
+
show_rev_ts,
|
467 |
],
|
468 |
lb_table_retriever_long_doc,
|
469 |
queue=True,
|
|
|
498 |
version,
|
499 |
],
|
500 |
[
|
501 |
+
domains,
|
502 |
+
langs,
|
503 |
selected_rerankings_reranker_ldoc,
|
504 |
lb_table_reranker_ldoc,
|
505 |
hidden_lb_table_reranker_ldoc,
|
|
|
512 |
hidden_lb_table_reranker_ldoc,
|
513 |
search_bar_reranker_ldoc,
|
514 |
version,
|
515 |
+
domains,
|
516 |
+
langs,
|
517 |
selected_rerankings_reranker_ldoc,
|
518 |
show_anonymous,
|
519 |
+
show_rev_ts,
|
520 |
)
|
521 |
+
metric.change(
|
522 |
update_doc_metric,
|
523 |
[
|
524 |
+
metric,
|
525 |
+
domains,
|
526 |
+
langs,
|
527 |
selected_rerankings_reranker_ldoc,
|
528 |
search_bar_reranker_ldoc,
|
529 |
show_anonymous,
|
530 |
+
show_rev_ts,
|
531 |
],
|
532 |
lb_table_reranker_ldoc,
|
533 |
queue=True,
|