Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -62,10 +62,15 @@ def generate(
|
|
62 |
}
|
63 |
|
64 |
def run_generation():
|
65 |
-
|
|
|
|
|
|
|
|
|
66 |
|
67 |
t = Thread(target=run_generation)
|
68 |
t.start()
|
|
|
69 |
|
70 |
outputs = []
|
71 |
for text in run_generation():
|
|
|
62 |
}
|
63 |
|
64 |
def run_generation():
|
65 |
+
try:
|
66 |
+
return pipe(input_text, **generate_kwargs)
|
67 |
+
except Exception as e:
|
68 |
+
gr.Error(f"Error in generation: {e}")
|
69 |
+
return []
|
70 |
|
71 |
t = Thread(target=run_generation)
|
72 |
t.start()
|
73 |
+
t.join() # Ensure the thread completes before proceeding
|
74 |
|
75 |
outputs = []
|
76 |
for text in run_generation():
|