Update app.py
Browse files
app.py
CHANGED
@@ -311,7 +311,11 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
311 |
|
312 |
if st.session_state.clicked:
|
313 |
# The message and nested widget will remain on the page
|
314 |
-
generate_audio()
|
|
|
|
|
|
|
|
|
315 |
|
316 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
317 |
|
|
|
311 |
|
312 |
if st.session_state.clicked:
|
313 |
# The message and nested widget will remain on the page
|
314 |
+
#generate_audio()
|
315 |
+
sound_file = BytesIO()
|
316 |
+
tts = gTTS(result['result'], lang='en')
|
317 |
+
tts.write_to_fp(sound_file)
|
318 |
+
st.audio(sound_file)
|
319 |
|
320 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
321 |
|