BenchmarkBot commited on
Commit
b075f8f
β€’
1 Parent(s): 35b1013

added submit button

Browse files
Files changed (1) hide show
  1. app.py +30 -54
app.py CHANGED
@@ -66,22 +66,17 @@ def change_tab(query_param):
66
  return gr.Tabs.update(selected=0)
67
 
68
 
69
- def search_tables(single_df, multi_df, query):
70
- filtered_single = single_df[single_df["Model πŸ€—"].str.contains(query)]
71
- filtered_multi = multi_df[multi_df["Model πŸ€—"].str.contains(query)]
72
- return filtered_single, filtered_multi
73
-
74
-
75
- def filter_tables(single_df, multi_df, backends, datatypes, threshold):
76
  filtered_single = single_df[single_df["Backend 🏭"].isin(backends)]
77
  filtered_single = filtered_single[filtered_single["Datatype πŸ“₯"].isin(
78
  datatypes)]
 
79
 
 
80
  filtered_multi = multi_df[multi_df["Backend 🏭"].isin(backends)]
81
  filtered_multi = filtered_multi[filtered_multi["Datatype πŸ“₯"].isin(
82
  datatypes)]
83
-
84
- filtered_single = single_df[single_df["Average H4 Score ⬆️"] >= threshold]
85
  filtered_multi = multi_df[multi_df["Average H4 Score ⬆️"] >= threshold]
86
 
87
  return filtered_single, filtered_multi
@@ -99,24 +94,24 @@ with demo:
99
  search_bar = gr.Textbox(
100
  label="Search πŸ”Ž",
101
  info="Search for a model",
102
- placeholder="Write and press ENTER...",
103
  elem_id="search-bar",
104
  )
105
 
106
- backend_checkboxes = gr.CheckboxGroup(
107
- choices=["pytorch", "onnxruntime"],
108
- value=["pytorch"],
109
- label="Backends 🏭",
110
- info="Select the backends",
111
- elem_id="backend-checkboxes",
112
- )
113
- datatype_checkboxes = gr.CheckboxGroup(
114
- choices=["float32", "float16"],
115
- value=["float32", "float16"],
116
- label="Datatypes πŸ“₯",
117
- info="Select the load datatypes",
118
- elem_id="datatype-checkboxes",
119
- )
 
120
 
121
  with gr.Row():
122
  with gr.Box(elem_id="threshold-slider-box"):
@@ -130,12 +125,12 @@ with demo:
130
  elem_id="threshold-slider",
131
  )
132
 
133
- # with gr.Row():
134
- # submit_button = gr.Button(
135
- # value="Submit πŸš€",
136
- # info="Submit the filters",
137
- # elem_id="submit-button",
138
- # )
139
 
140
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
141
  with gr.TabItem("πŸ–₯️ A100-80GB Benchmark πŸ‹οΈ", elem_id="A100-benchmark", id=0):
@@ -165,7 +160,7 @@ with demo:
165
  visible=False,
166
  )
167
 
168
- with gr.TabItem("πŸ–₯️ 4xA100-80GB Evaluation πŸ‹οΈ", elem_id="A100-evaluation", id=1):
169
  MULTI_A100_TEXT = """<h3>Multi-GPU (4xA100):</h3>
170
  <ul>
171
  <li>Singleton Batch (1)</li>
@@ -190,29 +185,10 @@ with demo:
190
  )
191
 
192
  # Callbacks
193
- search_bar.submit(
194
- search_tables,
195
- [single_A100_for_search, multi_A100_for_search, search_bar],
196
- [single_A100_leaderboard, multi_A100_leaderboard],
197
- )
198
- backend_checkboxes.select(
199
- filter_tables,
200
- [single_A100_for_search, multi_A100_for_search,
201
- backend_checkboxes, datatype_checkboxes, threshold_slider],
202
- [single_A100_leaderboard, multi_A100_leaderboard],
203
- )
204
- datatype_checkboxes.select(
205
- filter_tables,
206
- [single_A100_for_search, multi_A100_for_search,
207
- backend_checkboxes, datatype_checkboxes, threshold_slider],
208
- [single_A100_leaderboard, multi_A100_leaderboard],
209
- )
210
- threshold_slider.release(
211
- filter_tables,
212
- [single_A100_for_search, multi_A100_for_search,
213
- backend_checkboxes, datatype_checkboxes, threshold_slider],
214
- [single_A100_leaderboard, multi_A100_leaderboard],
215
- )
216
 
217
  with gr.Row():
218
  with gr.Accordion("πŸ“™ Citation", open=False):
 
66
  return gr.Tabs.update(selected=0)
67
 
68
 
69
+ def submit_query(single_df, multi_df, text, backends, datatypes, threshold):
70
+ filtered_single = single_df[single_df["Model πŸ€—"].str.contains(text)]
 
 
 
 
 
71
  filtered_single = single_df[single_df["Backend 🏭"].isin(backends)]
72
  filtered_single = filtered_single[filtered_single["Datatype πŸ“₯"].isin(
73
  datatypes)]
74
+ filtered_single = single_df[single_df["Average H4 Score ⬆️"] >= threshold]
75
 
76
+ filtered_multi = multi_df[multi_df["Model πŸ€—"].str.contains(text)]
77
  filtered_multi = multi_df[multi_df["Backend 🏭"].isin(backends)]
78
  filtered_multi = filtered_multi[filtered_multi["Datatype πŸ“₯"].isin(
79
  datatypes)]
 
 
80
  filtered_multi = multi_df[multi_df["Average H4 Score ⬆️"] >= threshold]
81
 
82
  return filtered_single, filtered_multi
 
94
  search_bar = gr.Textbox(
95
  label="Search πŸ”Ž",
96
  info="Search for a model",
 
97
  elem_id="search-bar",
98
  )
99
 
100
+ with gr.Column(scale=1):
101
+ backend_checkboxes = gr.CheckboxGroup(
102
+ choices=["pytorch", "onnxruntime"],
103
+ value=["pytorch"],
104
+ label="Backends 🏭",
105
+ info="Select the backends",
106
+ elem_id="backend-checkboxes",
107
+ )
108
+ datatype_checkboxes = gr.CheckboxGroup(
109
+ choices=["float32", "float16"],
110
+ value=["float32", "float16"],
111
+ label="Datatypes πŸ“₯",
112
+ info="Select the load datatypes",
113
+ elem_id="datatype-checkboxes",
114
+ )
115
 
116
  with gr.Row():
117
  with gr.Box(elem_id="threshold-slider-box"):
 
125
  elem_id="threshold-slider",
126
  )
127
 
128
+ with gr.Row():
129
+ submit_button = gr.Button(
130
+ value="Submit πŸš€",
131
+ info="Submit the filters",
132
+ elem_id="submit-button",
133
+ )
134
 
135
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
136
  with gr.TabItem("πŸ–₯️ A100-80GB Benchmark πŸ‹οΈ", elem_id="A100-benchmark", id=0):
 
160
  visible=False,
161
  )
162
 
163
+ with gr.TabItem("πŸ–₯️ 4xA100-80GB Benchmark πŸ‹οΈ", elem_id="4xA100-benchmark", id=1):
164
  MULTI_A100_TEXT = """<h3>Multi-GPU (4xA100):</h3>
165
  <ul>
166
  <li>Singleton Batch (1)</li>
 
185
  )
186
 
187
  # Callbacks
188
+ submit_button.click(submit_query,
189
+ [single_A100_for_search, multi_A100_for_search, search_bar,
190
+ backend_checkboxes, datatype_checkboxes, threshold_slider],
191
+ [single_A100_leaderboard, multi_A100_leaderboard])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
  with gr.Row():
194
  with gr.Accordion("πŸ“™ Citation", open=False):