BenchmarkBot commited on
Commit
a3310bf
β€’
1 Parent(s): 930b7c1

added threshold slider

Browse files
Files changed (1) hide show
  1. app.py +29 -0
app.py CHANGED
@@ -72,6 +72,12 @@ def search_tables(single_df, multi_df, query):
72
  return filtered_single, filtered_multi
73
 
74
 
 
 
 
 
 
 
75
  def filter_tables(single_df, multi_df, backends, datatypes):
76
  filtered_single = single_df[single_df["Backend 🏭"].isin(backends)]
77
  filtered_single = filtered_single[filtered_single["Datatype πŸ“₯"].isin(
@@ -98,6 +104,16 @@ with demo:
98
  placeholder="Write and press ENTER...",
99
  elem_id="search-bar",
100
  )
 
 
 
 
 
 
 
 
 
 
101
  backend_checkboxes = gr.CheckboxGroup(
102
  choices=["pytorch", "onnxruntime"],
103
  value=["pytorch"],
@@ -112,6 +128,12 @@ with demo:
112
  info="Select the load datatypes",
113
  elem_id="datatype-checkboxes",
114
  )
 
 
 
 
 
 
115
 
116
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
117
  with gr.TabItem("πŸ–₯️ A100-80GB Benchmark πŸ‹οΈ", elem_id="A100-benchmark", id=0):
@@ -163,6 +185,7 @@ with demo:
163
  visible=False,
164
  )
165
 
 
166
  search_bar.submit(
167
  search_tables,
168
  [single_A100_for_search, multi_A100_for_search, search_bar],
@@ -180,6 +203,12 @@ with demo:
180
  backend_checkboxes, datatype_checkboxes],
181
  [single_A100_leaderboard, multi_A100_leaderboard],
182
  )
 
 
 
 
 
 
183
 
184
  with gr.Row():
185
  with gr.Accordion("πŸ“™ Citation", open=False):
 
72
  return filtered_single, filtered_multi
73
 
74
 
75
+ def threshold_tables(single_df, multi_df, threshold):
76
+ filtered_single = single_df[single_df["Average H4 Score ⬆️"] >= threshold]
77
+ filtered_multi = multi_df[multi_df["Average H4 Score ⬆️"] >= threshold]
78
+ return filtered_single, filtered_multi
79
+
80
+
81
  def filter_tables(single_df, multi_df, backends, datatypes):
82
  filtered_single = single_df[single_df["Backend 🏭"].isin(backends)]
83
  filtered_single = filtered_single[filtered_single["Datatype πŸ“₯"].isin(
 
104
  placeholder="Write and press ENTER...",
105
  elem_id="search-bar",
106
  )
107
+ threshold_slider = gr.Slider(
108
+ label="Threshold πŸ“ˆ",
109
+ info="Filter by average H4 score",
110
+ min_value=0.0,
111
+ max_value=100.0,
112
+ step_size=1.0,
113
+ value=0.0,
114
+ elem_id="threshold-slider",
115
+ )
116
+
117
  backend_checkboxes = gr.CheckboxGroup(
118
  choices=["pytorch", "onnxruntime"],
119
  value=["pytorch"],
 
128
  info="Select the load datatypes",
129
  elem_id="datatype-checkboxes",
130
  )
131
+ with gr.Row():
132
+ submit_button = gr.Button(
133
+ label="Submit πŸš€",
134
+ info="Submit the filters",
135
+ elem_id="submit-button",
136
+ )
137
 
138
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
139
  with gr.TabItem("πŸ–₯️ A100-80GB Benchmark πŸ‹οΈ", elem_id="A100-benchmark", id=0):
 
185
  visible=False,
186
  )
187
 
188
+ # Callbacks
189
  search_bar.submit(
190
  search_tables,
191
  [single_A100_for_search, multi_A100_for_search, search_bar],
 
203
  backend_checkboxes, datatype_checkboxes],
204
  [single_A100_leaderboard, multi_A100_leaderboard],
205
  )
206
+ threshold_slider.change(
207
+ filter_tables,
208
+ [single_A100_for_search, multi_A100_for_search,
209
+ backend_checkboxes, datatype_checkboxes],
210
+ [single_A100_leaderboard, multi_A100_leaderboard],
211
+ )
212
 
213
  with gr.Row():
214
  with gr.Accordion("πŸ“™ Citation", open=False):