Spaces:
Runtime error
Runtime error
commit remote changes
Browse files- app.py +7 -1
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -41,7 +41,13 @@ def generate_response(
|
|
| 41 |
# Convert llm response to audio
|
| 42 |
# Return None to reset user input audio and
|
| 43 |
# llm response + user inputs in chatbot_history object to be displayed
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
bot_message_audio, warning = asyncio.run(text_to_speech(text=bot_message, voice=voice_short_name))
|
| 46 |
|
| 47 |
return None, chatbot_history, bot_message_audio
|
|
|
|
| 41 |
# Convert llm response to audio
|
| 42 |
# Return None to reset user input audio and
|
| 43 |
# llm response + user inputs in chatbot_history object to be displayed
|
| 44 |
+
if language_choice == "Spanish":
|
| 45 |
+
voice_short_name = "es-MX-JorgeNeural"
|
| 46 |
+
elif language_choice == "Japanese":
|
| 47 |
+
voice_short_name = "ja-JP-KeitaNeural"
|
| 48 |
+
else:
|
| 49 |
+
# default to an english voice otherwise
|
| 50 |
+
voice_short_name = "en-US-BrianNeural"
|
| 51 |
bot_message_audio, warning = asyncio.run(text_to_speech(text=bot_message, voice=voice_short_name))
|
| 52 |
|
| 53 |
return None, chatbot_history, bot_message_audio
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
faster-whisper==1.0.3
|
| 2 |
gradio==4.42.0
|
| 3 |
-
edge-tts==6.1.12
|
|
|
|
|
|
| 1 |
faster-whisper==1.0.3
|
| 2 |
gradio==4.42.0
|
| 3 |
+
edge-tts==6.1.12
|
| 4 |
+
openai==1.42.0
|