Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -103,7 +103,7 @@ def greet(product,description):
|
|
103 |
else:
|
104 |
text_str = a_list[0]
|
105 |
samples = tts.synthesize(text_str, speakers[-1])
|
106 |
-
yield gr.Audio
|
107 |
else:
|
108 |
output = llm.create_chat_completion(
|
109 |
messages=[
|
@@ -120,13 +120,12 @@ def greet(product,description):
|
|
120 |
partial_message = ""
|
121 |
tts = TTS(os.path.join(os.getcwd(), tts_model_str))
|
122 |
speakers = tts.get_speakers()
|
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 |
samples = tts.synthesize(delta.get('content', ''), speakers[-1])
|
128 |
-
yield gr.Audio
|
129 |
|
130 |
|
131 |
-
demo = gr.Interface(fn=greet, inputs=["text","text"],
|
132 |
demo.launch()
|
|
|
103 |
else:
|
104 |
text_str = a_list[0]
|
105 |
samples = tts.synthesize(text_str, speakers[-1])
|
106 |
+
yield gr.Audio(value=(tts.get_sampling_rate(), samples))
|
107 |
else:
|
108 |
output = llm.create_chat_completion(
|
109 |
messages=[
|
|
|
120 |
partial_message = ""
|
121 |
tts = TTS(os.path.join(os.getcwd(), tts_model_str))
|
122 |
speakers = tts.get_speakers()
|
|
|
123 |
for chunk in output:
|
124 |
delta = chunk['choices'][0]['delta']
|
125 |
if 'content' in delta:
|
126 |
samples = tts.synthesize(delta.get('content', ''), speakers[-1])
|
127 |
+
yield gr.Audio(value=(tts.get_sampling_rate(), samples))
|
128 |
|
129 |
|
130 |
+
demo = gr.Interface(fn=greet, inputs=["text","text"], concurrency_limit=10)
|
131 |
demo.launch()
|