Spaces:
Running
Running
BenchmarkBot
commited on
Commit
β’
a29a8d2
1
Parent(s):
fd0fd49
fix
Browse files
app.py
CHANGED
@@ -182,17 +182,16 @@ def filter_query(
|
|
182 |
quantization_scheme,
|
183 |
score,
|
184 |
memory,
|
185 |
-
|
186 |
):
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
&
|
191 |
-
& raw_df["backend.torch_dtype"].isin(datatypes)
|
192 |
& (
|
193 |
pd.concat(
|
194 |
[
|
195 |
-
|
196 |
for optimization in optimizations
|
197 |
],
|
198 |
axis=1,
|
@@ -203,7 +202,7 @@ def filter_query(
|
|
203 |
& (
|
204 |
pd.concat(
|
205 |
[
|
206 |
-
|
207 |
for quantization in quantization_scheme
|
208 |
],
|
209 |
axis=1,
|
@@ -211,8 +210,8 @@ def filter_query(
|
|
211 |
if len(quantization_scheme) > 0
|
212 |
else True
|
213 |
)
|
214 |
-
& (
|
215 |
-
& (
|
216 |
]
|
217 |
filtered_table = get_benchmark_table(filtered_df)
|
218 |
filtered_chart = get_benchmark_chart(filtered_df)
|
@@ -229,26 +228,29 @@ with demo:
|
|
229 |
|
230 |
with gr.Tabs(elem_classes="leaderboard-tabs"):
|
231 |
hardware_dataframes = {}
|
|
|
232 |
hardware_plots = {}
|
233 |
####################### HARDWARE TABS #######################
|
234 |
for hardware in ["A100-80GB", "RTX4090-24GB"]:
|
235 |
-
hardware_df = get_benchmark_df(benchmark=f"Succeeded-1x{hardware}")
|
236 |
-
hardware_table = get_benchmark_table(hardware_df)
|
237 |
-
hardware_chart = get_benchmark_chart(hardware_df)
|
238 |
-
del hardware_df
|
239 |
with gr.TabItem(f"{hardware} π₯οΈ", id=hardware):
|
240 |
with gr.Tabs(elem_classes="hardware-tabs"):
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
with gr.TabItem("Leaderboard π
", id=0):
|
242 |
gr.HTML(
|
243 |
"π Scroll to the right π for additional columns.",
|
244 |
elem_id="descriptive-text",
|
245 |
)
|
246 |
# Original leaderboard table
|
247 |
-
|
248 |
-
value=
|
249 |
headers=list(ALL_COLUMNS_MAPPING.values()),
|
250 |
datatype=ALL_COLUMNS_DATATYPES,
|
251 |
-
elem_id="hardware-
|
252 |
# show_label=False,
|
253 |
)
|
254 |
with gr.TabItem("Plot π", id=1):
|
@@ -258,10 +260,11 @@ with demo:
|
|
258 |
)
|
259 |
# Original leaderboard plot
|
260 |
hardware_plots[hardware] = gr.components.Plot(
|
261 |
-
value=
|
262 |
elem_id="hardware-plot",
|
263 |
show_label=False,
|
264 |
)
|
|
|
265 |
|
266 |
####################### CONTROL PANEL #######################
|
267 |
with gr.TabItem("Control Panel ποΈ", id=2):
|
@@ -343,9 +346,9 @@ with demo:
|
|
343 |
quantization_checkboxes,
|
344 |
score_slider,
|
345 |
memory_slider,
|
346 |
-
|
347 |
],
|
348 |
-
[
|
349 |
)
|
350 |
|
351 |
####################### ABOUT TAB #######################
|
|
|
182 |
quantization_scheme,
|
183 |
score,
|
184 |
memory,
|
185 |
+
dataframe,
|
186 |
):
|
187 |
+
filtered_df = dataframe[
|
188 |
+
dataframe["best_scored_model"].str.lower().str.contains(text.lower())
|
189 |
+
& dataframe["backend.name"].isin(backends)
|
190 |
+
& dataframe["backend.torch_dtype"].isin(datatypes)
|
|
|
191 |
& (
|
192 |
pd.concat(
|
193 |
[
|
194 |
+
dataframe["optimizations"].str.contains(optimization)
|
195 |
for optimization in optimizations
|
196 |
],
|
197 |
axis=1,
|
|
|
202 |
& (
|
203 |
pd.concat(
|
204 |
[
|
205 |
+
dataframe["quantization"] == quantization
|
206 |
for quantization in quantization_scheme
|
207 |
],
|
208 |
axis=1,
|
|
|
210 |
if len(quantization_scheme) > 0
|
211 |
else True
|
212 |
)
|
213 |
+
& (dataframe["best_score"] >= score)
|
214 |
+
& (dataframe["forward.peak_memory(MB)"] <= memory)
|
215 |
]
|
216 |
filtered_table = get_benchmark_table(filtered_df)
|
217 |
filtered_chart = get_benchmark_chart(filtered_df)
|
|
|
228 |
|
229 |
with gr.Tabs(elem_classes="leaderboard-tabs"):
|
230 |
hardware_dataframes = {}
|
231 |
+
hardware_tables = {}
|
232 |
hardware_plots = {}
|
233 |
####################### HARDWARE TABS #######################
|
234 |
for hardware in ["A100-80GB", "RTX4090-24GB"]:
|
|
|
|
|
|
|
|
|
235 |
with gr.TabItem(f"{hardware} π₯οΈ", id=hardware):
|
236 |
with gr.Tabs(elem_classes="hardware-tabs"):
|
237 |
+
# placeholder for full dataframe
|
238 |
+
hardware_df = get_benchmark_df(benchmark=f"Succeeded-1x{hardware}")
|
239 |
+
hardware_dataframes[hardware] = gr.components.Dataframe(
|
240 |
+
value=hardware_df,
|
241 |
+
visible=False,
|
242 |
+
)
|
243 |
with gr.TabItem("Leaderboard π
", id=0):
|
244 |
gr.HTML(
|
245 |
"π Scroll to the right π for additional columns.",
|
246 |
elem_id="descriptive-text",
|
247 |
)
|
248 |
# Original leaderboard table
|
249 |
+
hardware_tables[hardware] = gr.components.Dataframe(
|
250 |
+
value=get_benchmark_table(hardware_df),
|
251 |
headers=list(ALL_COLUMNS_MAPPING.values()),
|
252 |
datatype=ALL_COLUMNS_DATATYPES,
|
253 |
+
elem_id="hardware-table",
|
254 |
# show_label=False,
|
255 |
)
|
256 |
with gr.TabItem("Plot π", id=1):
|
|
|
260 |
)
|
261 |
# Original leaderboard plot
|
262 |
hardware_plots[hardware] = gr.components.Plot(
|
263 |
+
value=get_benchmark_chart(hardware_df),
|
264 |
elem_id="hardware-plot",
|
265 |
show_label=False,
|
266 |
)
|
267 |
+
del hardware_df
|
268 |
|
269 |
####################### CONTROL PANEL #######################
|
270 |
with gr.TabItem("Control Panel ποΈ", id=2):
|
|
|
346 |
quantization_checkboxes,
|
347 |
score_slider,
|
348 |
memory_slider,
|
349 |
+
hardware_dataframes[hardware],
|
350 |
],
|
351 |
+
[hardware_tables[hardware], hardware_plots[hardware]],
|
352 |
)
|
353 |
|
354 |
####################### ABOUT TAB #######################
|