Spaces:
Runtime error
Runtime error
Update TextGen/router.py
Browse files- TextGen/router.py +4 -9
TextGen/router.py
CHANGED
|
@@ -306,17 +306,12 @@ def generate_voice_coqui(message: VoiceMessage = None):
|
|
| 306 |
no_lang_auto_detect=False,
|
| 307 |
agree=True,
|
| 308 |
)
|
| 309 |
-
|
| 310 |
for chunk in result:
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
yield buffer
|
| 314 |
-
buffer = b""
|
| 315 |
-
if buffer: # Send any remaining data
|
| 316 |
-
yield buffer
|
| 317 |
|
| 318 |
-
|
| 319 |
-
return StreamingResponse(audio_stream(),media_type="audio/mpeg")
|
| 320 |
@app.post("/generate_song")
|
| 321 |
@app.get("/generate_song")
|
| 322 |
async def generate_song(request:SongRequest,httprequest: Request):
|
|
|
|
| 306 |
no_lang_auto_detect=False,
|
| 307 |
agree=True,
|
| 308 |
)
|
| 309 |
+
# Generate the audio stream from ElevenLabs
|
| 310 |
for chunk in result:
|
| 311 |
+
print("received : ",chunk)
|
| 312 |
+
yield chunk#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
|
| 314 |
+
return StreamingResponse(audio_stream())
|
|
|
|
| 315 |
@app.post("/generate_song")
|
| 316 |
@app.get("/generate_song")
|
| 317 |
async def generate_song(request:SongRequest,httprequest: Request):
|