Omnibus commited on
Commit
4fd8c9a
·
1 Parent(s): 558a9fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -33
app.py CHANGED
@@ -136,39 +136,7 @@ def send_it20(inputs,proc20=proc20):
136
  output20=proc20(inputs)
137
  return(output20)
138
 
139
- def clear_it(val):
140
- if int(val) != 0:
141
- val = 0
142
- else:
143
- val = 0
144
- pass
145
- return val
146
-
147
- def sesh_end(cnt,t_stamp):
148
- to = t_stamp + 120
149
- et = time.time()
150
- if et > to and t_stamp != 0:
151
- d=gr.update(value=0)
152
- tog=gr.update(value=1)
153
- #print(f'to: {to} et: {et}')
154
- else:
155
- if cnt != 0:
156
- d=gr.update(value=et)
157
- else:
158
- d=gr.update(value=0)
159
- tog=gr.update(value=0)
160
- #print (f'passing: to: {to} et: {et}')
161
- pass
162
- return d,tog
163
 
164
- def sesh_start():
165
- t = time.gmtime()
166
- t_stamp = time.time()
167
- current_time = time.strftime("%H:%M:%S", t)
168
- return gr.update(value=t_stamp),gr.update(value=t_stamp),gr.update(value=0)
169
-
170
- def clear_fn():
171
- return None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None
172
 
173
  with gr.Blocks(css="cake.css") as myface:
174
  with gr.Column():
@@ -301,7 +269,42 @@ with gr.Blocks(css="cake.css") as myface:
301
  start_box=gr.Number(interactive=False)
302
  end_box=gr.Number(interactive=False)
303
  tog_box=gr.Textbox(value=0,interactive=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
 
 
 
 
 
 
 
 
 
 
305
  start_box.change(sesh_end,[start_box,end_box],[start_box,tog_box],show_progress=False)
306
  run.click(sesh_start,None,[start_box,end_box,tog_box])
307
  run1=run.click(send_it1, inputs=[prompt], outputs=[output1])
@@ -332,4 +335,4 @@ with gr.Blocks(css="cake.css") as myface:
332
  tog_box.change(clear_it,tog_box,tog_box,cancels=[run1,run2,run3,run4,run5,run6,run7,run8,run9,run10,run11,run12,run13,run14,run15,run16,run17,run18,run19,run20,prompt1])
333
 
334
  myface.queue(concurrency_count=600,status_update_rate=1)
335
- myface.launch(inline=True,max_threads=600)
 
136
  output20=proc20(inputs)
137
  return(output20)
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
 
 
 
 
 
 
 
 
140
 
141
  with gr.Blocks(css="cake.css") as myface:
142
  with gr.Column():
 
269
  start_box=gr.Number(interactive=False)
270
  end_box=gr.Number(interactive=False)
271
  tog_box=gr.Textbox(value=0,interactive=False)
272
+
273
+
274
+ def clear_it(val):
275
+ if int(val) != 0:
276
+ val = 0
277
+ else:
278
+ val = 0
279
+ pass
280
+ return val
281
+
282
+ def sesh_end(cnt,t_stamp):
283
+ to = t_stamp + 120
284
+ et = time.time()
285
+ if et > to and t_stamp != 0:
286
+ d=gr.update(value=0)
287
+ tog=gr.update(value=1)
288
+ #print(f'to: {to} et: {et}')
289
+ else:
290
+ if cnt != 0:
291
+ d=gr.update(value=et)
292
+ else:
293
+ d=gr.update(value=0)
294
+ tog=gr.update(value=0)
295
+ #print (f'passing: to: {to} et: {et}')
296
+ pass
297
+ return d,tog
298
 
299
+ def sesh_start():
300
+ t = time.gmtime()
301
+ t_stamp = time.time()
302
+ current_time = time.strftime("%H:%M:%S", t)
303
+ return gr.update(value=t_stamp),gr.update(value=t_stamp),gr.update(value=0)
304
+
305
+ def clear_fn():
306
+ return None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None
307
+
308
  start_box.change(sesh_end,[start_box,end_box],[start_box,tog_box],show_progress=False)
309
  run.click(sesh_start,None,[start_box,end_box,tog_box])
310
  run1=run.click(send_it1, inputs=[prompt], outputs=[output1])
 
335
  tog_box.change(clear_it,tog_box,tog_box,cancels=[run1,run2,run3,run4,run5,run6,run7,run8,run9,run10,run11,run12,run13,run14,run15,run16,run17,run18,run19,run20,prompt1])
336
 
337
  myface.queue(concurrency_count=600,status_update_rate=1)
338
+ myface.launch(inline=True,max_threads=600,show_api=False)