Spaces:
Running
Running
BenchmarkBot
commited on
Commit
Β·
c1efc37
1
Parent(s):
a29a8d2
use placeholder
Browse files
app.py
CHANGED
@@ -182,16 +182,17 @@ def filter_query(
|
|
182 |
quantization_scheme,
|
183 |
score,
|
184 |
memory,
|
185 |
-
|
186 |
):
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
&
|
|
|
191 |
& (
|
192 |
pd.concat(
|
193 |
[
|
194 |
-
|
195 |
for optimization in optimizations
|
196 |
],
|
197 |
axis=1,
|
@@ -202,7 +203,7 @@ def filter_query(
|
|
202 |
& (
|
203 |
pd.concat(
|
204 |
[
|
205 |
-
|
206 |
for quantization in quantization_scheme
|
207 |
],
|
208 |
axis=1,
|
@@ -210,8 +211,8 @@ def filter_query(
|
|
210 |
if len(quantization_scheme) > 0
|
211 |
else True
|
212 |
)
|
213 |
-
& (
|
214 |
-
& (
|
215 |
]
|
216 |
filtered_table = get_benchmark_table(filtered_df)
|
217 |
filtered_chart = get_benchmark_chart(filtered_df)
|
@@ -227,19 +228,17 @@ with demo:
|
|
227 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="descriptive-text")
|
228 |
|
229 |
with gr.Tabs(elem_classes="leaderboard-tabs"):
|
230 |
-
|
231 |
hardware_tables = {}
|
232 |
hardware_plots = {}
|
233 |
####################### HARDWARE TABS #######################
|
234 |
-
for hardware in ["A100-80GB", "RTX4090-24GB"]:
|
235 |
-
|
|
|
|
|
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.",
|
@@ -264,7 +263,6 @@ with demo:
|
|
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):
|
@@ -273,13 +271,14 @@ with demo:
|
|
273 |
elem_id="descriptive-text",
|
274 |
)
|
275 |
with gr.Row():
|
276 |
-
with gr.Column(
|
277 |
search_bar = gr.Textbox(
|
278 |
label="Model π€",
|
279 |
info="π Search for a model name",
|
280 |
elem_id="search-bar",
|
281 |
)
|
282 |
-
|
|
|
283 |
with gr.Box():
|
284 |
score_slider = gr.Slider(
|
285 |
label="Open LLM Score π",
|
@@ -287,7 +286,7 @@ with demo:
|
|
287 |
value=0,
|
288 |
elem_id="threshold-slider",
|
289 |
)
|
290 |
-
with gr.Column(scale=
|
291 |
with gr.Box():
|
292 |
memory_slider = gr.Slider(
|
293 |
label="Peak Memory (MB) π",
|
@@ -297,8 +296,7 @@ with demo:
|
|
297 |
value=80 * 1024,
|
298 |
elem_id="memory-slider",
|
299 |
)
|
300 |
-
|
301 |
-
with gr.Column(scale=3):
|
302 |
backend_checkboxes = gr.CheckboxGroup(
|
303 |
label="Backends π",
|
304 |
choices=["pytorch", "onnxruntime"],
|
@@ -306,15 +304,16 @@ with demo:
|
|
306 |
info="βοΈ Select the backends",
|
307 |
elem_id="backend-checkboxes",
|
308 |
)
|
309 |
-
|
|
|
310 |
datatype_checkboxes = gr.CheckboxGroup(
|
311 |
-
label="Dtypes π₯",
|
312 |
choices=["float32", "float16"],
|
313 |
value=["float32", "float16"],
|
314 |
info="βοΈ Select the load dtypes",
|
315 |
elem_id="dtype-checkboxes",
|
316 |
)
|
317 |
-
with gr.Column(scale=
|
318 |
optimizations_checkboxes = gr.CheckboxGroup(
|
319 |
label="Optimizations π οΈ",
|
320 |
choices=["None", "BetterTransformer"],
|
@@ -322,9 +321,9 @@ with demo:
|
|
322 |
info="βοΈ Select the optimizations",
|
323 |
elem_id="optimizations-checkboxes",
|
324 |
)
|
325 |
-
with gr.Column(scale=
|
326 |
quantization_checkboxes = gr.CheckboxGroup(
|
327 |
-
label="
|
328 |
choices=["None", "BnB.4bit", "GPTQ.4bit"],
|
329 |
value=["None", "BnB.4bit", "GPTQ.4bit"],
|
330 |
info="βοΈ Select the quantization schemes",
|
@@ -346,7 +345,7 @@ with demo:
|
|
346 |
quantization_checkboxes,
|
347 |
score_slider,
|
348 |
memory_slider,
|
349 |
-
|
350 |
],
|
351 |
[hardware_tables[hardware], hardware_plots[hardware]],
|
352 |
)
|
|
|
182 |
quantization_scheme,
|
183 |
score,
|
184 |
memory,
|
185 |
+
hardware,
|
186 |
):
|
187 |
+
raw_df = get_benchmark_df(benchmark=f"Succeeded-1x{hardware}")
|
188 |
+
filtered_df = raw_df[
|
189 |
+
raw_df["best_scored_model"].str.lower().str.contains(text.lower())
|
190 |
+
& raw_df["backend.name"].isin(backends)
|
191 |
+
& raw_df["backend.torch_dtype"].isin(datatypes)
|
192 |
& (
|
193 |
pd.concat(
|
194 |
[
|
195 |
+
raw_df["optimizations"].str.contains(optimization)
|
196 |
for optimization in optimizations
|
197 |
],
|
198 |
axis=1,
|
|
|
203 |
& (
|
204 |
pd.concat(
|
205 |
[
|
206 |
+
raw_df["quantization"] == quantization
|
207 |
for quantization in quantization_scheme
|
208 |
],
|
209 |
axis=1,
|
|
|
211 |
if len(quantization_scheme) > 0
|
212 |
else True
|
213 |
)
|
214 |
+
& (raw_df["best_score"] >= score)
|
215 |
+
& (raw_df["forward.peak_memory(MB)"] <= memory)
|
216 |
]
|
217 |
filtered_table = get_benchmark_table(filtered_df)
|
218 |
filtered_chart = get_benchmark_chart(filtered_df)
|
|
|
228 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="descriptive-text")
|
229 |
|
230 |
with gr.Tabs(elem_classes="leaderboard-tabs"):
|
231 |
+
hardware_placeholders = {}
|
232 |
hardware_tables = {}
|
233 |
hardware_plots = {}
|
234 |
####################### HARDWARE TABS #######################
|
235 |
+
for i, hardware in enumerate(["A100-80GB", "RTX4090-24GB"]):
|
236 |
+
# dummy placeholder of the hardware name
|
237 |
+
hardware_placeholders[hardware] = gr.Textbox(value=hardware, visible=False)
|
238 |
+
with gr.TabItem(f"{hardware} π₯οΈ", id=i):
|
239 |
with gr.Tabs(elem_classes="hardware-tabs"):
|
240 |
# placeholder for full dataframe
|
241 |
hardware_df = get_benchmark_df(benchmark=f"Succeeded-1x{hardware}")
|
|
|
|
|
|
|
|
|
242 |
with gr.TabItem("Leaderboard π
", id=0):
|
243 |
gr.HTML(
|
244 |
"π Scroll to the right π for additional columns.",
|
|
|
263 |
elem_id="hardware-plot",
|
264 |
show_label=False,
|
265 |
)
|
|
|
266 |
|
267 |
####################### CONTROL PANEL #######################
|
268 |
with gr.TabItem("Control Panel ποΈ", id=2):
|
|
|
271 |
elem_id="descriptive-text",
|
272 |
)
|
273 |
with gr.Row():
|
274 |
+
with gr.Column():
|
275 |
search_bar = gr.Textbox(
|
276 |
label="Model π€",
|
277 |
info="π Search for a model name",
|
278 |
elem_id="search-bar",
|
279 |
)
|
280 |
+
with gr.Row():
|
281 |
+
with gr.Column(scale=1):
|
282 |
with gr.Box():
|
283 |
score_slider = gr.Slider(
|
284 |
label="Open LLM Score π",
|
|
|
286 |
value=0,
|
287 |
elem_id="threshold-slider",
|
288 |
)
|
289 |
+
with gr.Column(scale=1):
|
290 |
with gr.Box():
|
291 |
memory_slider = gr.Slider(
|
292 |
label="Peak Memory (MB) π",
|
|
|
296 |
value=80 * 1024,
|
297 |
elem_id="memory-slider",
|
298 |
)
|
299 |
+
with gr.Column(scale=1):
|
|
|
300 |
backend_checkboxes = gr.CheckboxGroup(
|
301 |
label="Backends π",
|
302 |
choices=["pytorch", "onnxruntime"],
|
|
|
304 |
info="βοΈ Select the backends",
|
305 |
elem_id="backend-checkboxes",
|
306 |
)
|
307 |
+
with gr.Row():
|
308 |
+
with gr.Column(scale=1):
|
309 |
datatype_checkboxes = gr.CheckboxGroup(
|
310 |
+
label="Load Dtypes π₯",
|
311 |
choices=["float32", "float16"],
|
312 |
value=["float32", "float16"],
|
313 |
info="βοΈ Select the load dtypes",
|
314 |
elem_id="dtype-checkboxes",
|
315 |
)
|
316 |
+
with gr.Column(scale=1):
|
317 |
optimizations_checkboxes = gr.CheckboxGroup(
|
318 |
label="Optimizations π οΈ",
|
319 |
choices=["None", "BetterTransformer"],
|
|
|
321 |
info="βοΈ Select the optimizations",
|
322 |
elem_id="optimizations-checkboxes",
|
323 |
)
|
324 |
+
with gr.Column(scale=1):
|
325 |
quantization_checkboxes = gr.CheckboxGroup(
|
326 |
+
label="Quantizations ποΈ",
|
327 |
choices=["None", "BnB.4bit", "GPTQ.4bit"],
|
328 |
value=["None", "BnB.4bit", "GPTQ.4bit"],
|
329 |
info="βοΈ Select the quantization schemes",
|
|
|
345 |
quantization_checkboxes,
|
346 |
score_slider,
|
347 |
memory_slider,
|
348 |
+
hardware_placeholders[hardware],
|
349 |
],
|
350 |
[hardware_tables[hardware], hardware_plots[hardware]],
|
351 |
)
|