xp3857 commited on
Commit
539dd4c
1 Parent(s): 267c82b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -54,12 +54,6 @@ def ac():
54
  print("Passing")
55
  pass
56
  return t
57
-
58
-
59
-
60
-
61
-
62
-
63
  def im_fn(put,fac="",h=None):
64
  if h == o:
65
  rn = random.randint(0, 19)
@@ -71,7 +65,8 @@ def ac():
71
  elif h != o:
72
  return(None,None)
73
  def cl_fac():
74
- return "",None,None,None,None
 
75
  with gr.Blocks() as b:
76
  with gr.Row():
77
  put = gr.Textbox()
@@ -88,10 +83,10 @@ def ac():
88
  t_switch=gr.Textbox(value=0)
89
  fac_b = gr.Textbox(value="",visible=False)
90
 
91
- b0=btn1.click(cl_fac,None,[fac_b,out1,out2,out3,out4],show_progress=False)
92
- b1=btn1.click(start,None,[t_state,t_switch])
93
  sta = t_state.change(end,t_state,t_switch,every=1)
94
- b2=btn1.click(im_fn,[put,fac_b,h],[out1,fac_b])
95
  b3=out1.change(im_fn,[put,fac_b,h],[out2,fac_b])
96
  b4=out2.change(im_fn,[put,fac_b,h],[out3,fac_b])
97
  b5=out3.change(im_fn,[put,fac_b,h],[out4,fac_b])
 
54
  print("Passing")
55
  pass
56
  return t
 
 
 
 
 
 
57
  def im_fn(put,fac="",h=None):
58
  if h == o:
59
  rn = random.randint(0, 19)
 
65
  elif h != o:
66
  return(None,None)
67
  def cl_fac():
68
+ t_state,t_switch=start()
69
+ return "",t_state,t_switch,None,None,None,None
70
  with gr.Blocks() as b:
71
  with gr.Row():
72
  put = gr.Textbox()
 
83
  t_switch=gr.Textbox(value=0)
84
  fac_b = gr.Textbox(value="",visible=False)
85
 
86
+ b0=btn1.click(cl_fac,None,[fac_b,t_state,t_switch,out1,out2,out3,out4],show_progress=False)
87
+ #b1=btn1.click(start,None,[t_state,t_switch])
88
  sta = t_state.change(end,t_state,t_switch,every=1)
89
+ b2=t_state.change(im_fn,[put,fac_b,h],[out1,fac_b])
90
  b3=out1.change(im_fn,[put,fac_b,h],[out2,fac_b])
91
  b4=out2.change(im_fn,[put,fac_b,h],[out3,fac_b])
92
  b5=out3.change(im_fn,[put,fac_b,h],[out4,fac_b])