Update app.py
Browse files
app.py
CHANGED
@@ -275,7 +275,7 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
275 |
sound_file = BytesIO()
|
276 |
tts = gTTS(result['result'], lang='en')
|
277 |
tts.write_to_fp(sound_file)
|
278 |
-
st.audio(sound_file)
|
279 |
st.session_state.sound_played = True
|
280 |
|
281 |
|
@@ -314,8 +314,8 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
314 |
|
315 |
|
316 |
# Create the two buttons
|
317 |
-
st.button("Display Image", on_click=generate_pdf)
|
318 |
-
st.button("Play Sound", on_click=generate_audio)
|
319 |
|
320 |
|
321 |
|
@@ -332,17 +332,16 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
332 |
full_response += item
|
333 |
message_placeholder.markdown(full_response + "▌")
|
334 |
message_placeholder.markdown(full_response)
|
|
|
|
|
335 |
|
336 |
if st.button("Display Image"):
|
337 |
-
|
338 |
-
st.sidebar.image(a)
|
339 |
|
340 |
|
341 |
if st.button("Play Sound"):
|
342 |
-
|
343 |
-
st.sidebar.audio(x)
|
344 |
|
345 |
-
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
346 |
|
347 |
|
348 |
|
|
|
275 |
sound_file = BytesIO()
|
276 |
tts = gTTS(result['result'], lang='en')
|
277 |
tts.write_to_fp(sound_file)
|
278 |
+
st.sidebar.audio(sound_file)
|
279 |
st.session_state.sound_played = True
|
280 |
|
281 |
|
|
|
314 |
|
315 |
|
316 |
# Create the two buttons
|
317 |
+
#st.button("Display Image", on_click=generate_pdf)
|
318 |
+
#st.button("Play Sound", on_click=generate_audio)
|
319 |
|
320 |
|
321 |
|
|
|
332 |
full_response += item
|
333 |
message_placeholder.markdown(full_response + "▌")
|
334 |
message_placeholder.markdown(full_response)
|
335 |
+
|
336 |
+
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
337 |
|
338 |
if st.button("Display Image"):
|
339 |
+
generate_pdf()
|
|
|
340 |
|
341 |
|
342 |
if st.button("Play Sound"):
|
343 |
+
generate_audio()
|
|
|
344 |
|
|
|
345 |
|
346 |
|
347 |
|