Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
hanhainebula
commited on
Commit
•
658d5a4
1
Parent(s):
1f30550
modify the default value of reranking selector
Browse files- app.py +2 -2
- src/utils.py +4 -1
app.py
CHANGED
@@ -128,11 +128,11 @@ with demo:
|
|
128 |
info="Search the retrieval methods"
|
129 |
)
|
130 |
# select reranking model
|
131 |
-
reranking_models = list(frozenset([eval_result.reranking_model for eval_result in raw_data]))
|
132 |
with gr.Row():
|
133 |
selected_rerankings = gr.Dropdown(
|
134 |
choices=reranking_models,
|
135 |
-
value=reranking_models,
|
136 |
label="Select the reranking models",
|
137 |
elem_id="reranking-select",
|
138 |
interactive=True,
|
|
|
128 |
info="Search the retrieval methods"
|
129 |
)
|
130 |
# select reranking model
|
131 |
+
reranking_models = sorted(list(frozenset([eval_result.reranking_model for eval_result in raw_data])))
|
132 |
with gr.Row():
|
133 |
selected_rerankings = gr.Dropdown(
|
134 |
choices=reranking_models,
|
135 |
+
# value=reranking_models,
|
136 |
label="Select the reranking models",
|
137 |
elem_id="reranking-select",
|
138 |
interactive=True,
|
src/utils.py
CHANGED
@@ -23,7 +23,10 @@ def remove_html(input_str):
|
|
23 |
|
24 |
|
25 |
def filter_models(df: pd.DataFrame, reranking_query: list) -> pd.DataFrame:
|
26 |
-
|
|
|
|
|
|
|
27 |
|
28 |
|
29 |
def filter_queries(query: str, df: pd.DataFrame) -> pd.DataFrame:
|
|
|
23 |
|
24 |
|
25 |
def filter_models(df: pd.DataFrame, reranking_query: list) -> pd.DataFrame:
|
26 |
+
if not reranking_query:
|
27 |
+
return df
|
28 |
+
else:
|
29 |
+
return df.loc[df[COL_NAME_RERANKING_MODEL].apply(remove_html).isin(reranking_query)]
|
30 |
|
31 |
|
32 |
def filter_queries(query: str, df: pd.DataFrame) -> pd.DataFrame:
|