Spaces:
Sleeping
Sleeping
Update TextGen/router.py
Browse files- TextGen/router.py +6 -7
TextGen/router.py
CHANGED
@@ -167,13 +167,12 @@ async def generate_wav(message: VoiceMessage):
|
|
167 |
except Exception as e:
|
168 |
raise HTTPException(status_code=500, detail=str(e))
|
169 |
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
raise HTTPException(status_code=500, detail=str(e))
|
177 |
@app.post("/generate_voice", response_class=StreamingResponse)
|
178 |
def generate_voice(message: VoiceMessage = None):
|
179 |
print("message",message)
|
|
|
167 |
except Exception as e:
|
168 |
raise HTTPException(status_code=500, detail=str(e))
|
169 |
|
170 |
+
def audio_stream(message):
|
171 |
+
|
172 |
+
# Generate the audio stream from ElevenLabs
|
173 |
+
for chunk in Eleven_client.generate(text=message.input, stream=True):
|
174 |
+
yield chunk
|
175 |
+
|
|
|
176 |
@app.post("/generate_voice", response_class=StreamingResponse)
|
177 |
def generate_voice(message: VoiceMessage = None):
|
178 |
print("message",message)
|