Spaces:
Runtime error
Runtime error
felix
commited on
Commit
·
907b8c2
1
Parent(s):
0408e1d
try debug the json issue
Browse files
app.py
CHANGED
@@ -147,321 +147,6 @@ def filter_models(
|
|
147 |
return filtered_df
|
148 |
|
149 |
|
150 |
-
# demo = gr.Blocks(css=custom_css)
|
151 |
-
# with demo:
|
152 |
-
# gr.HTML(TITLE)
|
153 |
-
# gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
|
154 |
-
#
|
155 |
-
# with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
156 |
-
# with gr.TabItem("🏅 LLM Benchmark", elem_id="llm-benchmark-tab-table", id=0):
|
157 |
-
# with gr.Row():
|
158 |
-
# with gr.Column():
|
159 |
-
# with gr.Row():
|
160 |
-
# search_bar = gr.Textbox(
|
161 |
-
# placeholder=" 🔍 Search for your model and press ENTER...",
|
162 |
-
# show_label=False,
|
163 |
-
# elem_id="search-bar",
|
164 |
-
# )
|
165 |
-
# with gr.Row():
|
166 |
-
# shown_columns = gr.CheckboxGroup(
|
167 |
-
# choices=[
|
168 |
-
# c
|
169 |
-
# for c in COLS
|
170 |
-
# if c
|
171 |
-
# not in [
|
172 |
-
# AutoEvalColumn.dummy.name,
|
173 |
-
# AutoEvalColumn.model.name,
|
174 |
-
# AutoEvalColumn.model_type_symbol.name,
|
175 |
-
# AutoEvalColumn.still_on_hub.name,
|
176 |
-
# ]
|
177 |
-
# ],
|
178 |
-
# value=[
|
179 |
-
# c
|
180 |
-
# for c in COLS_LITE
|
181 |
-
# if c
|
182 |
-
# not in [
|
183 |
-
# AutoEvalColumn.dummy.name,
|
184 |
-
# AutoEvalColumn.model.name,
|
185 |
-
# AutoEvalColumn.model_type_symbol.name,
|
186 |
-
# AutoEvalColumn.still_on_hub.name,
|
187 |
-
# ]
|
188 |
-
# ],
|
189 |
-
# label="Select columns to show",
|
190 |
-
# elem_id="column-select",
|
191 |
-
# interactive=True,
|
192 |
-
# )
|
193 |
-
# with gr.Row():
|
194 |
-
# deleted_models_visibility = gr.Checkbox(
|
195 |
-
# value=True, label="Show gated/private/deleted models", interactive=True
|
196 |
-
# )
|
197 |
-
# with gr.Column(min_width=320):
|
198 |
-
# with gr.Box(elem_id="box-filter"):
|
199 |
-
# filter_columns_type = gr.CheckboxGroup(
|
200 |
-
# label="Model types",
|
201 |
-
# choices=[
|
202 |
-
# ModelType.PT.to_str(),
|
203 |
-
# ModelType.FT.to_str(),
|
204 |
-
# ModelType.IFT.to_str(),
|
205 |
-
# ModelType.RL.to_str(),
|
206 |
-
# ],
|
207 |
-
# value=[
|
208 |
-
# ModelType.PT.to_str(),
|
209 |
-
# ModelType.FT.to_str(),
|
210 |
-
# ModelType.IFT.to_str(),
|
211 |
-
# ModelType.RL.to_str(),
|
212 |
-
# ],
|
213 |
-
# interactive=True,
|
214 |
-
# elem_id="filter-columns-type",
|
215 |
-
# )
|
216 |
-
# filter_columns_precision = gr.CheckboxGroup(
|
217 |
-
# label="Precision",
|
218 |
-
# choices=["torch.float16", "torch.bfloat16", "torch.float32", "8bit", "4bit", "GPTQ"],
|
219 |
-
# value=["torch.float16", "torch.bfloat16", "torch.float32", "8bit", "4bit", "GPTQ"],
|
220 |
-
# interactive=True,
|
221 |
-
# elem_id="filter-columns-precision",
|
222 |
-
# )
|
223 |
-
# filter_columns_size = gr.CheckboxGroup(
|
224 |
-
# label="Model sizes",
|
225 |
-
# choices=list(NUMERIC_INTERVALS.keys()),
|
226 |
-
# value=list(NUMERIC_INTERVALS.keys()),
|
227 |
-
# interactive=True,
|
228 |
-
# elem_id="filter-columns-size",
|
229 |
-
# )
|
230 |
-
#
|
231 |
-
# leaderboard_table = gr.components.Dataframe(
|
232 |
-
# value=leaderboard_df[
|
233 |
-
# [AutoEvalColumn.model_type_symbol.name, AutoEvalColumn.model.name]
|
234 |
-
# + shown_columns.value
|
235 |
-
# + [AutoEvalColumn.dummy.name]
|
236 |
-
# ],
|
237 |
-
# headers=[
|
238 |
-
# AutoEvalColumn.model_type_symbol.name,
|
239 |
-
# AutoEvalColumn.model.name,
|
240 |
-
# ]
|
241 |
-
# + shown_columns.value
|
242 |
-
# + [AutoEvalColumn.dummy.name],
|
243 |
-
# datatype=TYPES,
|
244 |
-
# max_rows=None,
|
245 |
-
# elem_id="leaderboard-table",
|
246 |
-
# interactive=False,
|
247 |
-
# visible=True,
|
248 |
-
# )
|
249 |
-
#
|
250 |
-
# # Dummy leaderboard for handling the case when the user uses backspace key
|
251 |
-
# hidden_leaderboard_table_for_search = gr.components.Dataframe(
|
252 |
-
# value=original_df,
|
253 |
-
# headers=COLS,
|
254 |
-
# datatype=TYPES,
|
255 |
-
# max_rows=None,
|
256 |
-
# visible=False,
|
257 |
-
# )
|
258 |
-
# search_bar.submit(
|
259 |
-
# update_table,
|
260 |
-
# [
|
261 |
-
# hidden_leaderboard_table_for_search,
|
262 |
-
# leaderboard_table,
|
263 |
-
# shown_columns,
|
264 |
-
# filter_columns_type,
|
265 |
-
# filter_columns_precision,
|
266 |
-
# filter_columns_size,
|
267 |
-
# deleted_models_visibility,
|
268 |
-
# search_bar,
|
269 |
-
# ],
|
270 |
-
# leaderboard_table,
|
271 |
-
# )
|
272 |
-
# shown_columns.change(
|
273 |
-
# update_table,
|
274 |
-
# [
|
275 |
-
# hidden_leaderboard_table_for_search,
|
276 |
-
# leaderboard_table,
|
277 |
-
# shown_columns,
|
278 |
-
# filter_columns_type,
|
279 |
-
# filter_columns_precision,
|
280 |
-
# filter_columns_size,
|
281 |
-
# deleted_models_visibility,
|
282 |
-
# search_bar,
|
283 |
-
# ],
|
284 |
-
# leaderboard_table,
|
285 |
-
# queue=True,
|
286 |
-
# )
|
287 |
-
# filter_columns_type.change(
|
288 |
-
# update_table,
|
289 |
-
# [
|
290 |
-
# hidden_leaderboard_table_for_search,
|
291 |
-
# leaderboard_table,
|
292 |
-
# shown_columns,
|
293 |
-
# filter_columns_type,
|
294 |
-
# filter_columns_precision,
|
295 |
-
# filter_columns_size,
|
296 |
-
# deleted_models_visibility,
|
297 |
-
# search_bar,
|
298 |
-
# ],
|
299 |
-
# leaderboard_table,
|
300 |
-
# queue=True,
|
301 |
-
# )
|
302 |
-
# filter_columns_precision.change(
|
303 |
-
# update_table,
|
304 |
-
# [
|
305 |
-
# hidden_leaderboard_table_for_search,
|
306 |
-
# leaderboard_table,
|
307 |
-
# shown_columns,
|
308 |
-
# filter_columns_type,
|
309 |
-
# filter_columns_precision,
|
310 |
-
# filter_columns_size,
|
311 |
-
# deleted_models_visibility,
|
312 |
-
# search_bar,
|
313 |
-
# ],
|
314 |
-
# leaderboard_table,
|
315 |
-
# queue=True,
|
316 |
-
# )
|
317 |
-
# filter_columns_size.change(
|
318 |
-
# update_table,
|
319 |
-
# [
|
320 |
-
# hidden_leaderboard_table_for_search,
|
321 |
-
# leaderboard_table,
|
322 |
-
# shown_columns,
|
323 |
-
# filter_columns_type,
|
324 |
-
# filter_columns_precision,
|
325 |
-
# filter_columns_size,
|
326 |
-
# deleted_models_visibility,
|
327 |
-
# search_bar,
|
328 |
-
# ],
|
329 |
-
# leaderboard_table,
|
330 |
-
# queue=True,
|
331 |
-
# )
|
332 |
-
# deleted_models_visibility.change(
|
333 |
-
# update_table,
|
334 |
-
# [
|
335 |
-
# hidden_leaderboard_table_for_search,
|
336 |
-
# leaderboard_table,
|
337 |
-
# shown_columns,
|
338 |
-
# filter_columns_type,
|
339 |
-
# filter_columns_precision,
|
340 |
-
# filter_columns_size,
|
341 |
-
# deleted_models_visibility,
|
342 |
-
# search_bar,
|
343 |
-
# ],
|
344 |
-
# leaderboard_table,
|
345 |
-
# queue=True,
|
346 |
-
# )
|
347 |
-
# with gr.TabItem("📝 About", elem_id="llm-benchmark-tab-table", id=2):
|
348 |
-
# gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
|
349 |
-
#
|
350 |
-
# with gr.TabItem("🚀 Submit here! ", elem_id="llm-benchmark-tab-table", id=3):
|
351 |
-
# with gr.Column():
|
352 |
-
# with gr.Row():
|
353 |
-
# gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
|
354 |
-
#
|
355 |
-
# with gr.Column():
|
356 |
-
# with gr.Accordion(
|
357 |
-
# f"✅ Finished Evaluations ({len(finished_eval_queue_df)})",
|
358 |
-
# open=False,
|
359 |
-
# ):
|
360 |
-
# with gr.Row():
|
361 |
-
# finished_eval_table = gr.components.Dataframe(
|
362 |
-
# value=finished_eval_queue_df,
|
363 |
-
# headers=EVAL_COLS,
|
364 |
-
# datatype=EVAL_TYPES,
|
365 |
-
# max_rows=5,
|
366 |
-
# )
|
367 |
-
# with gr.Accordion(
|
368 |
-
# f"🔄 Running Evaluation Queue ({len(running_eval_queue_df)})",
|
369 |
-
# open=False,
|
370 |
-
# ):
|
371 |
-
# with gr.Row():
|
372 |
-
# running_eval_table = gr.components.Dataframe(
|
373 |
-
# value=running_eval_queue_df,
|
374 |
-
# headers=EVAL_COLS,
|
375 |
-
# datatype=EVAL_TYPES,
|
376 |
-
# max_rows=5,
|
377 |
-
# )
|
378 |
-
#
|
379 |
-
# with gr.Accordion(
|
380 |
-
# f"⏳ Pending Evaluation Queue ({len(pending_eval_queue_df)})",
|
381 |
-
# open=False,
|
382 |
-
# ):
|
383 |
-
# with gr.Row():
|
384 |
-
# pending_eval_table = gr.components.Dataframe(
|
385 |
-
# value=pending_eval_queue_df,
|
386 |
-
# headers=EVAL_COLS,
|
387 |
-
# datatype=EVAL_TYPES,
|
388 |
-
# max_rows=5,
|
389 |
-
# )
|
390 |
-
# with gr.Row():
|
391 |
-
# gr.Markdown("# ✉️✨ Submit your model here!", elem_classes="markdown-text")
|
392 |
-
#
|
393 |
-
# with gr.Row():
|
394 |
-
# with gr.Column():
|
395 |
-
# model_name_textbox = gr.Textbox(label="Model name")
|
396 |
-
# revision_name_textbox = gr.Textbox(label="revision", placeholder="main")
|
397 |
-
# private = gr.Checkbox(False, label="Private", visible=not IS_PUBLIC)
|
398 |
-
# model_type = gr.Dropdown(
|
399 |
-
# choices=[
|
400 |
-
# ModelType.PT.to_str(" : "),
|
401 |
-
# ModelType.FT.to_str(" : "),
|
402 |
-
# ModelType.IFT.to_str(" : "),
|
403 |
-
# ModelType.RL.to_str(" : "),
|
404 |
-
# ],
|
405 |
-
# label="Model type",
|
406 |
-
# multiselect=False,
|
407 |
-
# value=None,
|
408 |
-
# interactive=True,
|
409 |
-
# )
|
410 |
-
#
|
411 |
-
# with gr.Column():
|
412 |
-
# precision = gr.Dropdown(
|
413 |
-
# choices=[
|
414 |
-
# "float16",
|
415 |
-
# "bfloat16",
|
416 |
-
# "8bit (LLM.int8)",
|
417 |
-
# "4bit (QLoRA / FP4)",
|
418 |
-
# "GPTQ"
|
419 |
-
# ],
|
420 |
-
# label="Precision",
|
421 |
-
# multiselect=False,
|
422 |
-
# value="float16",
|
423 |
-
# interactive=True,
|
424 |
-
# )
|
425 |
-
# weight_type = gr.Dropdown(
|
426 |
-
# choices=["Original", "Delta", "Adapter"],
|
427 |
-
# label="Weights type",
|
428 |
-
# multiselect=False,
|
429 |
-
# value="Original",
|
430 |
-
# interactive=True,
|
431 |
-
# )
|
432 |
-
# base_model_name_textbox = gr.Textbox(label="Base model (for delta or adapter weights)")
|
433 |
-
#
|
434 |
-
# submit_button = gr.Button("Submit Eval")
|
435 |
-
# submission_result = gr.Markdown()
|
436 |
-
# submit_button.click(
|
437 |
-
# add_new_eval,
|
438 |
-
# [
|
439 |
-
# model_name_textbox,
|
440 |
-
# base_model_name_textbox,
|
441 |
-
# revision_name_textbox,
|
442 |
-
# precision,
|
443 |
-
# private,
|
444 |
-
# weight_type,
|
445 |
-
# model_type,
|
446 |
-
# ],
|
447 |
-
# submission_result,
|
448 |
-
# )
|
449 |
-
#
|
450 |
-
# with gr.Row():
|
451 |
-
# with gr.Accordion("📙 Citation", open=False):
|
452 |
-
# citation_button = gr.Textbox(
|
453 |
-
# value=CITATION_BUTTON_TEXT,
|
454 |
-
# label=CITATION_BUTTON_LABEL,
|
455 |
-
# elem_id="citation-button",
|
456 |
-
# ).style(show_copy_button=True)
|
457 |
-
#
|
458 |
-
# dummy = gr.Textbox(visible=False)
|
459 |
-
# demo.load(
|
460 |
-
# change_tab,
|
461 |
-
# dummy,
|
462 |
-
# tabs,
|
463 |
-
# _js=get_window_url_params,
|
464 |
-
# )
|
465 |
|
466 |
dummy1 = gr.Textbox(visible=False)
|
467 |
|
@@ -472,6 +157,8 @@ hidden_leaderboard_table_for_search = gr.components.Dataframe(
|
|
472 |
)
|
473 |
|
474 |
def display(x, y):
|
|
|
|
|
475 |
return original_df
|
476 |
|
477 |
INTRODUCTION_TEXT = """
|
@@ -508,10 +195,4 @@ interface = gr.Interface(
|
|
508 |
outputs=[hidden_leaderboard_table_for_search]
|
509 |
)
|
510 |
|
511 |
-
# Client auth error.. need to see how this works.
|
512 |
-
#scheduler = BackgroundScheduler()
|
513 |
-
#scheduler.add_job(restart_space, "interval", seconds=21600)
|
514 |
-
#scheduler.start()
|
515 |
-
|
516 |
interface.launch()
|
517 |
-
#demo.queue(concurrency_count=40).launch()
|
|
|
147 |
return filtered_df
|
148 |
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
dummy1 = gr.Textbox(visible=False)
|
152 |
|
|
|
157 |
)
|
158 |
|
159 |
def display(x, y):
|
160 |
+
json_data = hidden_leaderboard_table_for_search.dataframe.to_json()
|
161 |
+
print(json_data) # Print JSON representation
|
162 |
return original_df
|
163 |
|
164 |
INTRODUCTION_TEXT = """
|
|
|
195 |
outputs=[hidden_leaderboard_table_for_search]
|
196 |
)
|
197 |
|
|
|
|
|
|
|
|
|
|
|
198 |
interface.launch()
|
|