CazC commited on
Commit
cc8b70c
·
verified ·
1 Parent(s): 094e924

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- worker() # call the worker function
 
 
 
12
 
13
- iface = gr.Interface(fn=kickoff_worker, inputs="text", outputs="text", live=True)
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