Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,13 @@ def generate_response(
|
|
40 |
# Convert llm response to audio
|
41 |
# Return None to reset user input audio and
|
42 |
# llm response + user inputs in chatbot_history object to be displayed
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
bot_message_audio, warning = asyncio.run(text_to_speech(text=bot_message, voice=voice_short_name))
|
45 |
|
46 |
return None, chatbot_history, bot_message_audio
|
|
|
40 |
# Convert llm response to audio
|
41 |
# Return None to reset user input audio and
|
42 |
# llm response + user inputs in chatbot_history object to be displayed
|
43 |
+
if language_choice == "Spanish":
|
44 |
+
voice_short_name = "es-MX-JorgeNeural"
|
45 |
+
elif language_choice == "Japanese":
|
46 |
+
voice_short_name = "ja-JP-KeitaNeural"
|
47 |
+
else:
|
48 |
+
# default to an english voice otherwise
|
49 |
+
voice_short_name = "en-US-BrianNeural"
|
50 |
bot_message_audio, warning = asyncio.run(text_to_speech(text=bot_message, voice=voice_short_name))
|
51 |
|
52 |
return None, chatbot_history, bot_message_audio
|