Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clean up
Browse files
app.py
CHANGED
@@ -129,25 +129,26 @@ def search_table(df: pd.DataFrame, query: str) -> pd.DataFrame:
|
|
129 |
|
130 |
def filter_queries(query: str, filtered_df: pd.DataFrame) -> pd.DataFrame:
|
131 |
"""Added by Abishek"""
|
132 |
-
if query
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
151 |
return filtered_df
|
152 |
|
153 |
|
|
|
129 |
|
130 |
def filter_queries(query: str, filtered_df: pd.DataFrame) -> pd.DataFrame:
|
131 |
"""Added by Abishek"""
|
132 |
+
if not query:
|
133 |
+
return filtered_df
|
134 |
+
|
135 |
+
final_df = []
|
136 |
+
queries = [q.strip() for q in query.split(";")]
|
137 |
+
for _q in queries:
|
138 |
+
_q = _q.strip()
|
139 |
+
if _q != "":
|
140 |
+
temp_filtered_df = search_table(filtered_df, _q)
|
141 |
+
if len(temp_filtered_df) > 0:
|
142 |
+
final_df.append(temp_filtered_df)
|
143 |
+
if len(final_df) > 0:
|
144 |
+
filtered_df = pd.concat(final_df)
|
145 |
+
filtered_df = filtered_df.drop_duplicates(
|
146 |
+
subset=[
|
147 |
+
AutoEvalColumn.model.name,
|
148 |
+
AutoEvalColumn.precision.name,
|
149 |
+
AutoEvalColumn.revision.name,
|
150 |
+
]
|
151 |
+
)
|
152 |
return filtered_df
|
153 |
|
154 |
|