Update app.py
Browse files
app.py
CHANGED
@@ -52,24 +52,16 @@ def ac():
|
|
52 |
print("Passing")
|
53 |
pass
|
54 |
return t
|
55 |
-
def im_fn(put,fac="",
|
56 |
if h == o:
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
vv=1
|
66 |
-
elif c1>=3:
|
67 |
-
vv=0
|
68 |
-
c1=0
|
69 |
-
return model(put),fac,vv
|
70 |
-
elif int(val)==0:
|
71 |
-
|
72 |
-
return None,"",0
|
73 |
elif h != o:
|
74 |
return(None,"")
|
75 |
def cl_fac():
|
@@ -96,10 +88,10 @@ def ac():
|
|
96 |
b0=btn1.click(cl_fac,None,[fac_b,fac_c,out1,out2,out3,out4],show_progress=False)
|
97 |
b1=btn1.click(start,None,[t_state,t_switch])
|
98 |
sta = t_state.change(end,t_state,t_switch,every=1)
|
99 |
-
b2=btn1.click(im_fn,[put,fac_b,
|
100 |
-
b3=out1.change(im_fn,[put,fac_b,
|
101 |
-
b4=out2.change(im_fn,[put,fac_b,
|
102 |
-
b5=out3.change(im_fn,[put,fac_b,
|
103 |
t_switch.change(clear,t_switch,t_switch, cancels=[sta,b1,b2,b3,b4,b5])
|
104 |
|
105 |
b.queue(concurrency_count=100).launch(show_api=False)
|
|
|
52 |
print("Passing")
|
53 |
pass
|
54 |
return t
|
55 |
+
def im_fn(put,fac="",h=None):
|
56 |
if h == o:
|
57 |
+
rn = random.randint(0, 19)
|
58 |
+
model=models[rn]
|
59 |
+
put = f"{put}{fac}"
|
60 |
+
fac = f"{fac} "
|
61 |
+
print (rn)
|
62 |
+
|
63 |
+
return model(put),fac
|
64 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
elif h != o:
|
66 |
return(None,"")
|
67 |
def cl_fac():
|
|
|
88 |
b0=btn1.click(cl_fac,None,[fac_b,fac_c,out1,out2,out3,out4],show_progress=False)
|
89 |
b1=btn1.click(start,None,[t_state,t_switch])
|
90 |
sta = t_state.change(end,t_state,t_switch,every=1)
|
91 |
+
b2=btn1.click(im_fn,[put,fac_b,h],[out1,fac_b])
|
92 |
+
b3=out1.change(im_fn,[put,fac_b,h],[out2,fac_b])
|
93 |
+
b4=out2.change(im_fn,[put,fac_b,h],[out3,fac_b])
|
94 |
+
b5=out3.change(im_fn,[put,fac_b,h],[out4,fac_b])
|
95 |
t_switch.change(clear,t_switch,t_switch, cancels=[sta,b1,b2,b3,b4,b5])
|
96 |
|
97 |
b.queue(concurrency_count=100).launch(show_api=False)
|