Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix: fix the bug in the annoymous checkbox
Browse files- src/utils.py +3 -2
src/utils.py
CHANGED
@@ -18,7 +18,8 @@ def filter_models(df: pd.DataFrame, reranking_query: list) -> pd.DataFrame:
|
|
18 |
return df.loc[df["Reranking Model"].isin(reranking_query)]
|
19 |
|
20 |
|
21 |
-
def filter_queries(query: str,
|
|
|
22 |
final_df = []
|
23 |
if query != "":
|
24 |
queries = [q.strip() for q in query.split(";")]
|
@@ -36,7 +37,6 @@ def filter_queries(query: str, filtered_df: pd.DataFrame) -> pd.DataFrame:
|
|
36 |
COL_NAME_RERANKING_MODEL,
|
37 |
]
|
38 |
)
|
39 |
-
|
40 |
return filtered_df
|
41 |
|
42 |
|
@@ -117,6 +117,7 @@ def update_table(
|
|
117 |
):
|
118 |
filtered_df = hidden_df
|
119 |
if not show_anonymous:
|
|
|
120 |
filtered_df = filtered_df[~filtered_df[COL_NAME_IS_ANONYMOUS]]
|
121 |
filtered_df = filter_models(filtered_df, reranking_query)
|
122 |
filtered_df = filter_queries(query, filtered_df)
|
|
|
18 |
return df.loc[df["Reranking Model"].isin(reranking_query)]
|
19 |
|
20 |
|
21 |
+
def filter_queries(query: str, df: pd.DataFrame) -> pd.DataFrame:
|
22 |
+
filtered_df = df.copy()
|
23 |
final_df = []
|
24 |
if query != "":
|
25 |
queries = [q.strip() for q in query.split(";")]
|
|
|
37 |
COL_NAME_RERANKING_MODEL,
|
38 |
]
|
39 |
)
|
|
|
40 |
return filtered_df
|
41 |
|
42 |
|
|
|
117 |
):
|
118 |
filtered_df = hidden_df
|
119 |
if not show_anonymous:
|
120 |
+
filtered_df = hidden_df.copy()
|
121 |
filtered_df = filtered_df[~filtered_df[COL_NAME_IS_ANONYMOUS]]
|
122 |
filtered_df = filter_models(filtered_df, reranking_query)
|
123 |
filtered_df = filter_queries(query, filtered_df)
|