Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Use gr.on
Browse files
app.py
CHANGED
@@ -325,27 +325,12 @@ with gr.Blocks() as demo_leaderboard:
|
|
325 |
datatype=TYPES,
|
326 |
visible=False,
|
327 |
)
|
328 |
-
search_bar.submit(
|
329 |
-
fn=update_table,
|
330 |
-
inputs=[
|
331 |
-
hidden_leaderboard_table_for_search,
|
332 |
-
shown_columns,
|
333 |
-
filter_columns_type,
|
334 |
-
filter_columns_precision,
|
335 |
-
filter_columns_size,
|
336 |
-
filter_columns_add_special_tokens,
|
337 |
-
filter_columns_num_few_shots,
|
338 |
-
deleted_models_visibility,
|
339 |
-
merged_models_visibility,
|
340 |
-
flagged_models_visibility,
|
341 |
-
search_bar,
|
342 |
-
],
|
343 |
-
outputs=leaderboard_table,
|
344 |
-
)
|
345 |
|
346 |
# Define a hidden component that will trigger a reload only if a query parameter has been set
|
347 |
hidden_search_bar = gr.Textbox(value="", visible=False)
|
348 |
-
|
|
|
|
|
349 |
fn=update_table,
|
350 |
inputs=[
|
351 |
hidden_leaderboard_table_for_search,
|
@@ -362,6 +347,7 @@ with gr.Blocks() as demo_leaderboard:
|
|
362 |
],
|
363 |
outputs=leaderboard_table,
|
364 |
)
|
|
|
365 |
# Check query parameter once at startup and update search bar + hidden component
|
366 |
demo_leaderboard.load(fn=load_query, inputs=[], outputs=[search_bar, hidden_search_bar])
|
367 |
|
|
|
325 |
datatype=TYPES,
|
326 |
visible=False,
|
327 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
|
329 |
# Define a hidden component that will trigger a reload only if a query parameter has been set
|
330 |
hidden_search_bar = gr.Textbox(value="", visible=False)
|
331 |
+
|
332 |
+
gr.on(
|
333 |
+
triggers=[search_bar.submit, hidden_search_bar.change],
|
334 |
fn=update_table,
|
335 |
inputs=[
|
336 |
hidden_leaderboard_table_for_search,
|
|
|
347 |
],
|
348 |
outputs=leaderboard_table,
|
349 |
)
|
350 |
+
|
351 |
# Check query parameter once at startup and update search bar + hidden component
|
352 |
demo_leaderboard.load(fn=load_query, inputs=[], outputs=[search_bar, hidden_search_bar])
|
353 |
|