albertvillanova HF staff commited on
Commit
1c1cb58
1 Parent(s): 9c39267

Fix clear_details for load_details_btn

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. src/details.py +2 -1
app.py CHANGED
@@ -110,7 +110,7 @@ with gr.Blocks(fill_height=True) as demo:
110
  outputs=subtask,
111
  )
112
  gr.on(
113
- triggers=[model_id_1.change, model_id_2.change, subtask.change, details_task.change],
114
  fn=update_load_details_component,
115
  inputs=[model_id_1, model_id_2, subtask],
116
  outputs=load_details_btn,
@@ -132,7 +132,7 @@ with gr.Blocks(fill_height=True) as demo:
132
  )
133
  clear_details_btn.click(
134
  fn=clear_details,
135
- outputs=[model_id_1, model_id_2, details_dataframe_1, details_dataframe_2, details_task, subtask, sample_idx],
136
  )
137
 
138
  demo.launch()
 
110
  outputs=subtask,
111
  )
112
  gr.on(
113
+ triggers=[model_id_1.input, model_id_2.input, subtask.input, details_task.input],
114
  fn=update_load_details_component,
115
  inputs=[model_id_1, model_id_2, subtask],
116
  outputs=load_details_btn,
 
132
  )
133
  clear_details_btn.click(
134
  fn=clear_details,
135
+ outputs=[model_id_1, model_id_2, details_dataframe_1, details_dataframe_2, details_task, subtask, load_details_btn, sample_idx],
136
  )
137
 
138
  demo.launch()
src/details.py CHANGED
@@ -75,8 +75,9 @@ def update_sample_idx_component(*dfs):
75
 
76
 
77
  def clear_details():
78
- # model_id_1, model_id_2, details_dataframe_1, details_dataframe_2, details_task, subtask, sample_idx
79
  return (
80
  None, None, None, None, None, None,
 
81
  gr.Number(label="Sample Index", info="Index of the sample to be displayed", value=0, minimum=0,visible=False),
82
  )
 
75
 
76
 
77
  def clear_details():
78
+ # model_id_1, model_id_2, details_dataframe_1, details_dataframe_2, details_task, subtask, load_details_btn, sample_idx
79
  return (
80
  None, None, None, None, None, None,
81
+ gr.Button("Load Details", interactive=False),
82
  gr.Number(label="Sample Index", info="Index of the sample to be displayed", value=0, minimum=0,visible=False),
83
  )