albertvillanova HF staff commited on
Commit
54202cb
1 Parent(s): 8f68cc2

Add Clear Results button

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py CHANGED
@@ -169,6 +169,20 @@ def update_tasks_component():
169
  )
170
 
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  def update_subtasks_component(task):
173
  return gr.Radio(
174
  SUBTASKS.get(task),
@@ -262,6 +276,7 @@ with gr.Blocks(fill_height=True) as demo:
262
  interactive=False,
263
  )
264
  load_results_btn = gr.Button("Load Results", interactive=False)
 
265
  with gr.Tab("Results"):
266
  results = gr.HTML()
267
  with gr.Tab("Configs"):
@@ -310,6 +325,10 @@ with gr.Blocks(fill_height=True) as demo:
310
  inputs=[task, dataframe_1, dataframe_2],
311
  outputs=[results, configs],
312
  )
 
 
 
 
313
 
314
  details_task.change(
315
  fn=update_subtasks_component,
 
169
  )
170
 
171
 
172
+ def clear_results():
173
+ # model_id_1, model_id_2, dataframe_1, dataframe_2, task
174
+ return (
175
+ None, None, None, None,
176
+ gr.Radio(
177
+ ["All"] + list(TASKS.values()),
178
+ label="Tasks",
179
+ info="Evaluation tasks to be displayed",
180
+ value="All",
181
+ interactive=False,
182
+ ),
183
+ )
184
+
185
+
186
  def update_subtasks_component(task):
187
  return gr.Radio(
188
  SUBTASKS.get(task),
 
276
  interactive=False,
277
  )
278
  load_results_btn = gr.Button("Load Results", interactive=False)
279
+ clear_results_btn = gr.Button("Clear Results")
280
  with gr.Tab("Results"):
281
  results = gr.HTML()
282
  with gr.Tab("Configs"):
 
325
  inputs=[task, dataframe_1, dataframe_2],
326
  outputs=[results, configs],
327
  )
328
+ clear_results_btn.click(
329
+ fn=clear_results,
330
+ outputs=[model_id_1, model_id_2, dataframe_1, dataframe_2, task],
331
+ )
332
 
333
  details_task.change(
334
  fn=update_subtasks_component,