hysts HF staff commited on
Commit
31ca7f6
·
1 Parent(s): f70f437
Files changed (1) hide show
  1. app.py +20 -19
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
- final_df = []
134
- queries = [q.strip() for q in query.split(";")]
135
- for _q in queries:
136
- _q = _q.strip()
137
- if _q != "":
138
- temp_filtered_df = search_table(filtered_df, _q)
139
- if len(temp_filtered_df) > 0:
140
- final_df.append(temp_filtered_df)
141
- if len(final_df) > 0:
142
- filtered_df = pd.concat(final_df)
143
- filtered_df = filtered_df.drop_duplicates(
144
- subset=[
145
- AutoEvalColumn.model.name,
146
- AutoEvalColumn.precision.name,
147
- AutoEvalColumn.revision.name,
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