Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -146,7 +146,7 @@ document.querySelector("#close").addEventListener("click", function(){
|
|
146 |
|
147 |
def ac():
|
148 |
def clear():
|
149 |
-
return gr.update(value=0),gr.update(value=0)
|
150 |
def start():
|
151 |
print ("start")
|
152 |
stamp = time.time()
|
@@ -157,7 +157,7 @@ def ac():
|
|
157 |
if ti > ts and stamp != 0:
|
158 |
print("Cancelling")
|
159 |
#return gr.update(value=1),gr.HTML.update(f"{t_out}", visible=True)
|
160 |
-
return gr.update(value=1)
|
161 |
|
162 |
else:
|
163 |
print("Passing")
|
@@ -204,14 +204,14 @@ def ac():
|
|
204 |
btn1.click(cl_fac,None,fac_b)
|
205 |
|
206 |
b1=btn1.click(start,None,[t_state,t_switch])
|
207 |
-
sta = t_state.change(end,t_state,[t_switch
|
208 |
|
209 |
b2=btn1.click(im_fn,[put,fac_b,h],[out1,fac_b])
|
210 |
b3=out1.change(im_fn,[put,fac_b,h],[out2,fac_b])
|
211 |
b4=out2.change(im_fn,[put,fac_b,h],[out3,fac_b])
|
212 |
b5=out3.change(im_fn,[put,fac_b,h],[out4,fac_b])
|
213 |
|
214 |
-
t_switch.change(clear,None,[t_switch,fac_b], cancels=[sta,b2,b3,b4,b5])
|
215 |
|
216 |
b.queue(concurrency_count=100).launch(show_api=False)
|
217 |
ac()
|
|
|
146 |
|
147 |
def ac():
|
148 |
def clear():
|
149 |
+
return gr.update(value=0),gr.update(value=0),gr.Accordion.update(label="Timeout",open=True,visible=True)
|
150 |
def start():
|
151 |
print ("start")
|
152 |
stamp = time.time()
|
|
|
157 |
if ti > ts and stamp != 0:
|
158 |
print("Cancelling")
|
159 |
#return gr.update(value=1),gr.HTML.update(f"{t_out}", visible=True)
|
160 |
+
return gr.update(value=1)
|
161 |
|
162 |
else:
|
163 |
print("Passing")
|
|
|
204 |
btn1.click(cl_fac,None,fac_b)
|
205 |
|
206 |
b1=btn1.click(start,None,[t_state,t_switch])
|
207 |
+
sta = t_state.change(end,t_state,[t_switch],every=1)
|
208 |
|
209 |
b2=btn1.click(im_fn,[put,fac_b,h],[out1,fac_b])
|
210 |
b3=out1.change(im_fn,[put,fac_b,h],[out2,fac_b])
|
211 |
b4=out2.change(im_fn,[put,fac_b,h],[out3,fac_b])
|
212 |
b5=out3.change(im_fn,[put,fac_b,h],[out4,fac_b])
|
213 |
|
214 |
+
t_switch.change(clear,None,[t_switch,fac_b,acc], cancels=[sta,b2,b3,b4,b5])
|
215 |
|
216 |
b.queue(concurrency_count=100).launch(show_api=False)
|
217 |
ac()
|