Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -159,11 +159,13 @@ def generate(
|
|
| 159 |
|
| 160 |
final_response = "".join(outputs)
|
| 161 |
|
|
|
|
|
|
|
|
|
|
| 162 |
if is_tts and voice:
|
| 163 |
output_file = asyncio.run(text_to_speech(final_response, voice))
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
yield final_response # Return text response
|
| 167 |
|
| 168 |
demo = gr.ChatInterface(
|
| 169 |
fn=generate,
|
|
|
|
| 159 |
|
| 160 |
final_response = "".join(outputs)
|
| 161 |
|
| 162 |
+
# Yield text response first
|
| 163 |
+
yield final_response
|
| 164 |
+
|
| 165 |
if is_tts and voice:
|
| 166 |
output_file = asyncio.run(text_to_speech(final_response, voice))
|
| 167 |
+
# Return playable audio separately
|
| 168 |
+
yield gr.Audio(output_file, autoplay=True)
|
|
|
|
| 169 |
|
| 170 |
demo = gr.ChatInterface(
|
| 171 |
fn=generate,
|