xp3857 commited on
Commit
27dfb54
1 Parent(s): 51acf99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -105,7 +105,7 @@ loading=("""
105
  }
106
  }
107
  </style>
108
- <div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>""")
109
  def ac():
110
  def clear():
111
  return gr.update(value=0),gr.update(value=0)
@@ -140,8 +140,8 @@ def ac():
140
  with gr.Column():
141
  with gr.Row():
142
  btn1 = gr.Button("Run")
143
- btn2 = gr.Button("Clear",style="background:blue;")
144
- message=gr.HTML("")
145
  with gr.Row():
146
  out1 = gr.Image()
147
  out2 = gr.Image()
@@ -158,17 +158,17 @@ def ac():
158
  fac_b = gr.Textbox(value="",visible=False)
159
 
160
  def noth():
161
- return
162
  #a1=btn1.click(noth,None,btn1,every=1)
163
  btn1.click(cl_fac,None,[fac_b,message])
164
  b1=btn1.click(start,None,[t_state,t_switch])
165
- sta = t_state.change(end,t_state,[t_switch,message],every=1,show_progress=True)
166
  b2=btn1.click(im_fn,[put,fac_b,h],[out1,fac_b], show_progress=False)
167
  b3=out1.change(im_fn,[put,fac_b,h],[out2,fac_b], show_progress=False)
168
  b4=out2.change(im_fn,[put,fac_b,h],[out3,fac_b], show_progress=False)
169
  b5=out3.change(im_fn,[put,fac_b,h],[out4,fac_b], show_progress=False)
170
  swi=t_switch.change(clear,None,[t_switch,fac_b], cancels=[sta,b2,b3,b4,b5],show_progress=False)
171
- btn2.click(noth,None,None,cancels=[b1,sta,b2,b3,b4,b5,swi],show_progress=False)
172
  btn2.click(clear_all, None,[fac_b,put,out1,out2,out3,out4,t_state,t_switch],cancels=[b1,sta,b2,b3,b4,b5,swi],show_progress=False)
173
  b.queue(concurrency_count=100).launch(show_api=False)
174
  ac()
 
105
  }
106
  }
107
  </style>
108
+ <div class="lds-ellipsis"></div>""")
109
  def ac():
110
  def clear():
111
  return gr.update(value=0),gr.update(value=0)
 
140
  with gr.Column():
141
  with gr.Row():
142
  btn1 = gr.Button("Run")
143
+ btn2 = gr.Button("Clear")
144
+ message=gr.HTML("<div></div>")
145
  with gr.Row():
146
  out1 = gr.Image()
147
  out2 = gr.Image()
 
158
  fac_b = gr.Textbox(value="",visible=False)
159
 
160
  def noth():
161
+ return gr.HTML.update("<div></div>")
162
  #a1=btn1.click(noth,None,btn1,every=1)
163
  btn1.click(cl_fac,None,[fac_b,message])
164
  b1=btn1.click(start,None,[t_state,t_switch])
165
+ sta = t_state.change(end,t_state,[t_switch,message],every=1,show_progress=False)
166
  b2=btn1.click(im_fn,[put,fac_b,h],[out1,fac_b], show_progress=False)
167
  b3=out1.change(im_fn,[put,fac_b,h],[out2,fac_b], show_progress=False)
168
  b4=out2.change(im_fn,[put,fac_b,h],[out3,fac_b], show_progress=False)
169
  b5=out3.change(im_fn,[put,fac_b,h],[out4,fac_b], show_progress=False)
170
  swi=t_switch.change(clear,None,[t_switch,fac_b], cancels=[sta,b2,b3,b4,b5],show_progress=False)
171
+ btn2.click(noth,None,message,cancels=[b1,sta,b2,b3,b4,b5,swi],show_progress=False)
172
  btn2.click(clear_all, None,[fac_b,put,out1,out2,out3,out4,t_state,t_switch],cancels=[b1,sta,b2,b3,b4,b5,swi],show_progress=False)
173
  b.queue(concurrency_count=100).launch(show_api=False)
174
  ac()