Spaces:
Sleeping
Sleeping
John Langley
commited on
Commit
•
eaad3e8
1
Parent(s):
4bae818
change to cpu
Browse files
app.py
CHANGED
@@ -172,18 +172,11 @@ with gr.Blocks(title="Voice chat with LLM") as demo:
|
|
172 |
def handle_speech_generation(sentence, chatbot_history, chatbot_voice):
|
173 |
if sentence != "":
|
174 |
print("Processing sentence")
|
175 |
-
# generate speech by cloning a voice using default
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
split_sentences=True
|
181 |
-
)
|
182 |
-
yield (sentence, chatbot_history, wave_header_chunk())
|
183 |
-
#generated_speech = generate_speech_for_sentence(chatbot_history, chatbot_voice, sentence, xtts_model, None, return_as_byte=True)
|
184 |
-
#if generated_speech is not None:
|
185 |
-
# _, audio_dict = generated_speech
|
186 |
-
# yield (sentence, chatbot_history, audio_dict["value"])
|
187 |
|
188 |
if initial_greeting:
|
189 |
# Process only the initial greeting if specified
|
|
|
172 |
def handle_speech_generation(sentence, chatbot_history, chatbot_voice):
|
173 |
if sentence != "":
|
174 |
print("Processing sentence")
|
175 |
+
# generate speech by cloning a voice using default setting
|
176 |
+
generated_speech = generate_speech_for_sentence(chatbot_history, chatbot_voice, sentence, xtts_model, None, return_as_byte=True)
|
177 |
+
if generated_speech is not None:
|
178 |
+
_, audio_dict = generated_speech
|
179 |
+
yield (sentence, chatbot_history, audio_dict["value"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
if initial_greeting:
|
182 |
# Process only the initial greeting if specified
|