Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -121,13 +121,13 @@ async def greet(product,description):
|
|
121 |
)
|
122 |
partial_message = ""
|
123 |
tts = TTS(os.path.join(os.getcwd(), tts_model_str))
|
|
|
|
|
124 |
for chunk in output:
|
125 |
delta = chunk['choices'][0]['delta']
|
126 |
if 'content' in delta:
|
127 |
-
tts = TTS(os.path.join(os.getcwd(), tts_model_str))
|
128 |
-
speakers = tts.get_speakers()
|
129 |
samples = tts.synthesize(delta.get('content', ''), speakers[-1])
|
130 |
-
yield (tts.get_sampling_rate(), samples)
|
131 |
|
132 |
|
133 |
demo = gr.Interface(fn=greet, inputs=["text","text"], outputs=gr.Audio(), concurrency_limit=10)
|
|
|
121 |
)
|
122 |
partial_message = ""
|
123 |
tts = TTS(os.path.join(os.getcwd(), tts_model_str))
|
124 |
+
speakers = tts.get_speakers()
|
125 |
+
tts = TTS(os.path.join(os.getcwd(), tts_model_str))
|
126 |
for chunk in output:
|
127 |
delta = chunk['choices'][0]['delta']
|
128 |
if 'content' in delta:
|
|
|
|
|
129 |
samples = tts.synthesize(delta.get('content', ''), speakers[-1])
|
130 |
+
yield gr.Audio(value=(tts.get_sampling_rate(), samples))
|
131 |
|
132 |
|
133 |
demo = gr.Interface(fn=greet, inputs=["text","text"], outputs=gr.Audio(), concurrency_limit=10)
|