albertvillanova HF staff commited on
Commit
c53c13a
1 Parent(s): 8c2cbf9

Simplify tabs

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -111,33 +111,34 @@ with gr.Blocks(fill_height=True) as demo:
111
  model_id_2 = gr.Dropdown(choices=list(latest_result_path_per_model.keys()), label="Results")
112
  load_btn_2 = gr.Button("Load")
113
 
 
114
  with gr.Row():
115
  with gr.Tab("All"):
116
- compared_results_all = gr.Dataframe(
117
  label="Results",
118
  headers=["Parameters", "Model-1", "Model-2"],
119
  interactive=False,
120
  column_widths=["30%", "30%", "30%"],
121
  wrap=True,
122
- )
123
  with gr.Tab("Results"):
124
- compared_results_results = gr.Dataframe(
125
  label="Results",
126
  headers=["Parameters", "Model-1", "Model-2"],
127
  interactive=False,
128
  column_widths=["30%", "30%", "30%"],
129
  wrap=True,
130
- )
131
 
132
  load_btn_1.click(
133
  fn=render_result_1,
134
- inputs=[model_id_1, compared_results_all, compared_results_results],
135
- outputs=[compared_results_all, compared_results_results],
136
  )
137
  load_btn_2.click(
138
  fn=render_result_2,
139
- inputs=[model_id_2, compared_results_all, compared_results_results],
140
- outputs=[compared_results_all, compared_results_results],
141
  )
142
 
143
  demo.launch()
 
111
  model_id_2 = gr.Dropdown(choices=list(latest_result_path_per_model.keys()), label="Results")
112
  load_btn_2 = gr.Button("Load")
113
 
114
+ results = []
115
  with gr.Row():
116
  with gr.Tab("All"):
117
+ results.append(gr.Dataframe(
118
  label="Results",
119
  headers=["Parameters", "Model-1", "Model-2"],
120
  interactive=False,
121
  column_widths=["30%", "30%", "30%"],
122
  wrap=True,
123
+ ))
124
  with gr.Tab("Results"):
125
+ results.append(gr.Dataframe(
126
  label="Results",
127
  headers=["Parameters", "Model-1", "Model-2"],
128
  interactive=False,
129
  column_widths=["30%", "30%", "30%"],
130
  wrap=True,
131
+ ))
132
 
133
  load_btn_1.click(
134
  fn=render_result_1,
135
+ inputs=[model_id_1, *results],
136
+ outputs=[*results],
137
  )
138
  load_btn_2.click(
139
  fn=render_result_2,
140
+ inputs=[model_id_2, *results],
141
+ outputs=[*results],
142
  )
143
 
144
  demo.launch()