gabboud commited on
Commit
0344239
·
1 Parent(s): f0753e2

disable stop button

Browse files
Files changed (1) hide show
  1. app.py +17 -16
app.py CHANGED
@@ -108,7 +108,7 @@ with gr.Blocks(title="RFD3 Test") as demo:
108
 
109
  with gr.Row():
110
  run_btn = gr.Button("Run Generation", variant="primary")
111
- stop_btn = gr.Button("Stop Generation", variant="stop", visible=False)
112
  runtextbox = gr.Textbox(label="Run status", value="Waiting for generation run...")
113
 
114
 
@@ -133,10 +133,11 @@ with gr.Blocks(title="RFD3 Test") as demo:
133
 
134
 
135
 
 
 
 
 
136
  generation_event = run_btn.click(
137
- lambda: (gr.update(visible=False), gr.update(visible=True)),
138
- outputs=[run_btn, stop_btn]
139
- ).then(
140
  generation_with_input_config, inputs=[config_upload, scaffold_upload, num_batches, num_designs_per_batch, extra_args, max_duration], outputs=[runtextbox, gen_directory, gen_results]
141
  ).then(
142
  update_batch_choices,
@@ -146,19 +147,19 @@ with gr.Blocks(title="RFD3 Test") as demo:
146
  download_results_as_zip,
147
  inputs=gen_directory,
148
  outputs=output_file
149
- ).then(
150
- lambda: (gr.update(visible=True), gr.update(visible=False)),
151
- outputs=[run_btn, stop_btn]
152
- )
153
 
154
- stop_btn.click(
155
- lambda: gr.update(value="Generation cancelled by user."),
156
- outputs=runtextbox,
157
- cancels=[generation_event]
158
- ).then(
159
- lambda: (gr.update(visible=True), gr.update(visible=False)),
160
- outputs=[run_btn, stop_btn]
161
- )
162
 
163
 
164
  batch_dropdown.change(update_designs, inputs=[batch_dropdown, gen_results], outputs=[design_dropdown])
 
108
 
109
  with gr.Row():
110
  run_btn = gr.Button("Run Generation", variant="primary")
111
+ #stop_btn = gr.Button("Stop Generation", variant="stop", visible=False)
112
  runtextbox = gr.Textbox(label="Run status", value="Waiting for generation run...")
113
 
114
 
 
133
 
134
 
135
 
136
+ #generation_event = run_btn.click(
137
+ # lambda: (gr.update(visible=False), gr.update(visible=True)),
138
+ # outputs=[run_btn, stop_btn]
139
+ #).then(
140
  generation_event = run_btn.click(
 
 
 
141
  generation_with_input_config, inputs=[config_upload, scaffold_upload, num_batches, num_designs_per_batch, extra_args, max_duration], outputs=[runtextbox, gen_directory, gen_results]
142
  ).then(
143
  update_batch_choices,
 
147
  download_results_as_zip,
148
  inputs=gen_directory,
149
  outputs=output_file
150
+ )#.then(
151
+ # lambda: (gr.update(visible=True), gr.update(visible=False)),
152
+ # outputs=[run_btn, stop_btn]
153
+ #)
154
 
155
+ #stop_btn.click(
156
+ # lambda: gr.update(value="Generation cancelled by user."),
157
+ # outputs=runtextbox,
158
+ # cancels=[generation_event]
159
+ #).then(
160
+ # lambda: (gr.update(visible=True), gr.update(visible=False)),
161
+ # outputs=[run_btn, stop_btn]
162
+ #)
163
 
164
 
165
  batch_dropdown.change(update_designs, inputs=[batch_dropdown, gen_results], outputs=[design_dropdown])