BenchmarkBot commited on
Commit
c1efc37
β€’
1 Parent(s): a29a8d2

use placeholder

Browse files
Files changed (1) hide show
  1. app.py +27 -28
app.py CHANGED
@@ -182,16 +182,17 @@ def filter_query(
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,7 +203,7 @@ def filter_query(
202
  & (
203
  pd.concat(
204
  [
205
- dataframe["quantization"] == quantization
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
- & (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)
@@ -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
- 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.",
@@ -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(scale=4):
277
  search_bar = gr.Textbox(
278
  label="Model πŸ€—",
279
  info="πŸ” Search for a model name",
280
  elem_id="search-bar",
281
  )
282
- with gr.Column(scale=4):
 
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=4):
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
- with gr.Row():
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
- with gr.Column(scale=3):
 
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=3):
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=3):
326
  quantization_checkboxes = gr.CheckboxGroup(
327
- label="Quantization πŸ—œοΈ",
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
- hardware_dataframes[hardware],
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
  )