Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
feat: implement the no reranking button
Browse files- app.py +13 -1
- 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():
|
|
|
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():
|
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",]
|