niulx commited on
Commit
3df76ef
1 Parent(s): a893db0

Update app.py

Browse files

do not use update

Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -214,11 +214,11 @@ def image_change():
214
  os.unlink(file_path)
215
  elif os.path.isdir(file_path):
216
  shutil.rmtree(file_path)
217
- return gr.Button.update("1.2 Load original masks",visible = False), gr.Button.update("1.2 Load edited masks",visible = False), gr.Checkbox.update(label = "Show Segmentation",visible = False)
218
 
219
 
220
  def button_clickable(is_clickable):
221
- return gr.Button.update(interactive=is_clickable)
222
 
223
 
224
 
@@ -360,10 +360,10 @@ with gr.Blocks() as demo:
360
  return "Optimization finished!"
361
 
362
  def immediate_update():
363
- return gr.Button.update("Processing...", interactive=False)
364
 
365
  def immediate_update2():
366
- return gr.Button.update("Run Optimization (Check Log for Completion).", interactive=True)
367
  add_button.click(fn=immediate_update, inputs=[], outputs=[add_button])
368
 
369
  add_button.click(run_optimization_wrapper,
@@ -381,7 +381,7 @@ with gr.Blocks() as demo:
381
  add_button.click(fn=immediate_update2, inputs=[], outputs=[add_button])
382
  #add_button.update()
383
  def change_text():
384
- return gr.Textbox.update("Optimization Finished!", interactive = False)
385
  '''txt_box.change(fn=lambda x: gr.Button.update(value="Optimization Finished!", interactive=True),
386
  inputs=[txt_box], outputs=[add_button])
387
  def change_text2():
 
214
  os.unlink(file_path)
215
  elif os.path.isdir(file_path):
216
  shutil.rmtree(file_path)
217
+ return gr.Button("1.2 Load original masks",visible = False), gr.Button("1.2 Load edited masks",visible = False), gr.Checkbox(label = "Show Segmentation",visible = False)
218
 
219
 
220
  def button_clickable(is_clickable):
221
+ return gr.Button(interactive=is_clickable)
222
 
223
 
224
 
 
360
  return "Optimization finished!"
361
 
362
  def immediate_update():
363
+ return gr.Button("Processing...", interactive=False)
364
 
365
  def immediate_update2():
366
+ return gr.Button("Run Optimization (Check Log for Completion).", interactive=True)
367
  add_button.click(fn=immediate_update, inputs=[], outputs=[add_button])
368
 
369
  add_button.click(run_optimization_wrapper,
 
381
  add_button.click(fn=immediate_update2, inputs=[], outputs=[add_button])
382
  #add_button.update()
383
  def change_text():
384
+ return gr.Textbox("Optimization Finished!", interactive = False)
385
  '''txt_box.change(fn=lambda x: gr.Button.update(value="Optimization Finished!", interactive=True),
386
  inputs=[txt_box], outputs=[add_button])
387
  def change_text2():