Spaces:
Running
on
A10G
Running
on
A10G
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,9 +8,12 @@ def greet(name):
|
|
| 8 |
|
| 9 |
def kickoff_worker():
|
| 10 |
from worker import worker # import the worker function
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
iface = gr.Interface(fn=kickoff_worker,
|
| 14 |
iface.launch()
|
| 15 |
print("Launching worker...")
|
| 16 |
# kickoff_worker() # kickoff the worker after launching the interface
|
|
|
|
| 8 |
|
| 9 |
def kickoff_worker():
|
| 10 |
from worker import worker # import the worker function
|
| 11 |
+
try:
|
| 12 |
+
worker() # call the worker function
|
| 13 |
+
except Exception as e:
|
| 14 |
+
return f"Error: {e}"
|
| 15 |
|
| 16 |
+
iface = gr.Interface(fn=kickoff_worker, outputs="text", live=True)
|
| 17 |
iface.launch()
|
| 18 |
print("Launching worker...")
|
| 19 |
# kickoff_worker() # kickoff the worker after launching the interface
|