xp3857 commited on
Commit
510f059
1 Parent(s): c421e90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -30,12 +30,7 @@ models=[
30
  o = os.getenv("P")
31
 
32
  def ac():
33
- def clear(v):
34
- if int(v) != 0:
35
- v = 0
36
- else:
37
- v = 0
38
- pass
39
  return gr.update(value=0),gr.update(value=0)
40
  def start():
41
  stamp = time.time()
@@ -61,7 +56,7 @@ def ac():
61
  print (rn)
62
  return model(put),fac,gr.update(value=1)
63
  elif int(fac_c)!=1:
64
- return None,"",gr.update(value=0)
65
  elif h != o:
66
  return(None,"",0)
67
  def cl_fac():
@@ -96,9 +91,10 @@ def ac():
96
  b3=out1.change(im_fn,[put,fac_b,fac_c,h],[out2,fac_b,fac_c])
97
  b4=out2.change(im_fn,[put,fac_b,fac_c,h],[out3,fac_b,fac_c])
98
  b5=out3.change(im_fn,[put,fac_b,fac_c,h],[out4,fac_b,fac_c])
 
99
  b2=btn1.click(im_fn,[put,fac_b,fac_d,h],[out1,fac_b,fac_c])
100
  #b0=btn1.click(cl_fac,None,[fac_b,fac_c,out1,out2,out3,out4],show_progress=False)
101
- t_switch.change(clear,t_switch,[t_switch,fac_c], cancels=[sta,b2,b3,b4,b5])
102
 
103
  b.queue(concurrency_count=100).launch(show_api=False)
104
  ac()
 
30
  o = os.getenv("P")
31
 
32
  def ac():
33
+ def clear():
 
 
 
 
 
34
  return gr.update(value=0),gr.update(value=0)
35
  def start():
36
  stamp = time.time()
 
56
  print (rn)
57
  return model(put),fac,gr.update(value=1)
58
  elif int(fac_c)!=1:
59
+ pass
60
  elif h != o:
61
  return(None,"",0)
62
  def cl_fac():
 
91
  b3=out1.change(im_fn,[put,fac_b,fac_c,h],[out2,fac_b,fac_c])
92
  b4=out2.change(im_fn,[put,fac_b,fac_c,h],[out3,fac_b,fac_c])
93
  b5=out3.change(im_fn,[put,fac_b,fac_c,h],[out4,fac_b,fac_c])
94
+ b6=out4.change(clear,None,[t_switch,fac_c])
95
  b2=btn1.click(im_fn,[put,fac_b,fac_d,h],[out1,fac_b,fac_c])
96
  #b0=btn1.click(cl_fac,None,[fac_b,fac_c,out1,out2,out3,out4],show_progress=False)
97
+ t_switch.change(clear,None,[t_switch,fac_c], cancels=[sta,b2,b3,b4,b5])
98
 
99
  b.queue(concurrency_count=100).launch(show_api=False)
100
  ac()