Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -234,18 +234,22 @@ with demo:
|
|
234 |
# Link the refresh button to the refresh_status function
|
235 |
refresh_button.click(refresh_status, None, [sys_status_output])
|
236 |
|
237 |
-
# Load the initial status using update_status function
|
238 |
-
demo.load(update_status, inputs=None, outputs=[sys_status_output], every=2, queue=False)
|
239 |
-
|
240 |
graudio.stop_recording(handle_upload_audio, inputs=[graudio, grmodel_textbox, groutputs[0]], outputs=groutputs)
|
241 |
graudio.upload(handle_upload_audio, inputs=[graudio, grmodel_textbox, groutputs[0]], outputs=groutputs)
|
242 |
|
243 |
|
|
|
|
|
|
|
|
|
|
|
244 |
|
245 |
-
|
246 |
-
|
|
|
|
|
|
|
247 |
# Launch the Gradio app
|
248 |
demo.launch(share=True)
|
249 |
-
demo.load(queue=False)
|
250 |
|
251 |
print('launched\n\n')
|
|
|
234 |
# Link the refresh button to the refresh_status function
|
235 |
refresh_button.click(refresh_status, None, [sys_status_output])
|
236 |
|
|
|
|
|
|
|
237 |
graudio.stop_recording(handle_upload_audio, inputs=[graudio, grmodel_textbox, groutputs[0]], outputs=groutputs)
|
238 |
graudio.upload(handle_upload_audio, inputs=[graudio, grmodel_textbox, groutputs[0]], outputs=groutputs)
|
239 |
|
240 |
|
241 |
+
@spaces.GPU
|
242 |
+
def onload():
|
243 |
+
while True:
|
244 |
+
print('onload loop excution')
|
245 |
+
time.sleep(2)
|
246 |
|
247 |
+
|
248 |
+
return update_status();
|
249 |
+
|
250 |
+
# Load the initial status using update_status function
|
251 |
+
demo.load(onload, inputs=None, outputs=[sys_status_output], queue=False)
|
252 |
# Launch the Gradio app
|
253 |
demo.launch(share=True)
|
|
|
254 |
|
255 |
print('launched\n\n')
|