Update app.py
Browse files
app.py
CHANGED
|
@@ -319,16 +319,22 @@ if prompt := st.chat_input("How can I help you today?"):
|
|
| 319 |
# st.session_state.sound_played = True
|
| 320 |
|
| 321 |
# Create the two buttons
|
| 322 |
-
st.button("Display Image", on_click=generate_pdf)
|
| 323 |
-
st.button("Play Sound", on_click=generate_audio)
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
if not st.session_state.image_displayed:
|
| 327 |
generate_pdf()
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
if not st.session_state.sound_played:
|
| 331 |
generate_audio()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 332 |
|
| 333 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
| 334 |
|
|
|
|
| 319 |
# st.session_state.sound_played = True
|
| 320 |
|
| 321 |
# Create the two buttons
|
| 322 |
+
#st.button("Display Image", on_click=generate_pdf)
|
| 323 |
+
#st.button("Play Sound", on_click=generate_audio)
|
| 324 |
+
|
| 325 |
+
if st.sidebar.button("Display Image"):
|
|
|
|
| 326 |
generate_pdf()
|
| 327 |
+
|
| 328 |
+
if st.sidebar.button("Play Sound"):
|
|
|
|
| 329 |
generate_audio()
|
| 330 |
+
|
| 331 |
+
# # Check if the image has been displayed and display it if it has not
|
| 332 |
+
# if not st.session_state.image_displayed:
|
| 333 |
+
# generate_pdf()
|
| 334 |
+
|
| 335 |
+
# # Check if the sound has been played and play it if it has not
|
| 336 |
+
# if not st.session_state.sound_played:
|
| 337 |
+
# generate_audio()
|
| 338 |
|
| 339 |
st.session_state.messages.append({"role": "assistant", "content": full_response})
|
| 340 |
|