BenchmarkBot commited on
Commit
53e3aab
β€’
1 Parent(s): 3d79a97

fix search

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -60,13 +60,10 @@ def change_tab(query_param):
60
  return gr.Tabs.update(selected=0)
61
 
62
 
63
- def search_table(dfs, query):
64
- filtered_dfs = []
65
- for df in dfs:
66
- filtered_df = filter_table(df, query)
67
- filtered_dfs.append(filtered_df)
68
-
69
- return filtered_dfs
70
 
71
 
72
  def filter_table(df, backends):
@@ -149,10 +146,11 @@ with demo:
149
  max_rows=None,
150
  visible=False,
151
  )
 
152
  search_bar.submit(
153
- search_table,
154
- [[single_A100_for_search, multi_A100_for_search], search_bar],
155
- [single_A100_for_search, multi_A100_for_search],
156
  )
157
  # backend_checkboxes.select(
158
  # filter_table,
 
60
  return gr.Tabs.update(selected=0)
61
 
62
 
63
+ def search_tables(single_df, multi_df, query):
64
+ filtered_single = single_df[single_df["Model πŸ€—"].str.contains(query)]
65
+ filtered_multi = multi_df[multi_df["Model πŸ€—"].str.contains(query)]
66
+ return filtered_single, filtered_multi
 
 
 
67
 
68
 
69
  def filter_table(df, backends):
 
146
  max_rows=None,
147
  visible=False,
148
  )
149
+
150
  search_bar.submit(
151
+ search_tables,
152
+ [single_A100_for_search, multi_A100_for_search, search_bar],
153
+ [single_A100_leaderboard, multi_A100_leaderboard],
154
  )
155
  # backend_checkboxes.select(
156
  # filter_table,