BenchmarkBot commited on
Commit
6bc8c31
1 Parent(s): 8af7268

fix submit query

Browse files
Files changed (1) hide show
  1. app.py +15 -18
app.py CHANGED
@@ -68,24 +68,21 @@ def get_benchmark_df(benchmark):
68
  # return gr.Tabs.update(selected=0)
69
 
70
 
71
- def submit_query(text, backends, datatypes, threshold, *raw_dfs):
72
- filtered_dfs = []
73
- for raw_df in raw_dfs:
74
- # extract the average score (float) from the clickable score (clickable markdown)
75
- # raw_df["Average H4 Score ⬆️"] = raw_df["Average H4 Score ⬆️"].apply(
76
- # extract_score_from_clickable)
77
- filtered_df = raw_df[
78
- raw_df["Model 🤗"].str.contains(text) &
79
- raw_df["Backend 🏭"].isin(backends) &
80
- raw_df["Datatype 📥"].isin(datatypes) &
81
- (raw_df["Average H4 Score ⬆️"] >= threshold)
82
- ]
83
- # filtered_df["Average H4 Score ⬆️"] = filtered_df["Average H4 Score ⬆️"].apply(
84
- # make_clickable_score)
85
-
86
- filtered_dfs.append(filtered_df)
87
-
88
- return filtered_dfs
89
 
90
 
91
  # Define demo interface
 
68
  # return gr.Tabs.update(selected=0)
69
 
70
 
71
+ def submit_query(text, backends, datatypes, threshold, raw_df):
72
+
73
+ # extract the average score (float) from the clickable score (clickable markdown)
74
+ # raw_df["Average H4 Score ⬆️"] = raw_df["Average H4 Score ⬆️"].apply(
75
+ # extract_score_from_clickable)
76
+ filtered_df = raw_df[
77
+ raw_df["Model 🤗"].str.contains(text) &
78
+ raw_df["Backend 🏭"].isin(backends) &
79
+ raw_df["Datatype 📥"].isin(datatypes) &
80
+ (raw_df["Average H4 Score ⬆️"] >= threshold)
81
+ ]
82
+ # filtered_df["Average H4 Score ⬆️"] = filtered_df["Average H4 Score ⬆️"].apply(
83
+ # make_clickable_score)
84
+
85
+ return filtered_df
 
 
 
86
 
87
 
88
  # Define demo interface