Spaces:
Sleeping
Sleeping
Commit
·
cdc99c7
1
Parent(s):
4ea7492
Update app.py
Browse files
app.py
CHANGED
|
@@ -140,7 +140,6 @@ if clear_chat_button:
|
|
| 140 |
# Clear the entire session and chat
|
| 141 |
st.session_state['flowmessages'] = []
|
| 142 |
|
| 143 |
-
# If the "Submit" button is clicked
|
| 144 |
# If the "Submit" button is clicked
|
| 145 |
if submit:
|
| 146 |
# Display loading message while processing
|
|
@@ -169,13 +168,13 @@ if submit:
|
|
| 169 |
|
| 170 |
# Embed audio in the webpage without saving it
|
| 171 |
st.header(':blue[Listen or Download] :loud_sound:')
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
|
|
|
| 175 |
|
|
|
|
|
|
|
| 176 |
|
| 177 |
else:
|
| 178 |
-
st.subheader("Error: Unable to get response. Please try again later.")
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
|
|
|
| 140 |
# Clear the entire session and chat
|
| 141 |
st.session_state['flowmessages'] = []
|
| 142 |
|
|
|
|
| 143 |
# If the "Submit" button is clicked
|
| 144 |
if submit:
|
| 145 |
# Display loading message while processing
|
|
|
|
| 168 |
|
| 169 |
# Embed audio in the webpage without saving it
|
| 170 |
st.header(':blue[Listen or Download] :loud_sound:')
|
| 171 |
+
|
| 172 |
+
# Listen Button
|
| 173 |
+
if st.button("🔊 Listen"):
|
| 174 |
+
st.audio(audio_response.content, format="audio/mp3", start_time=0)
|
| 175 |
|
| 176 |
+
# Download Button
|
| 177 |
+
st.button("💾 Download Audio", key="download_button", on_click=download_audio, args=(audio_response.content,))
|
| 178 |
|
| 179 |
else:
|
| 180 |
+
st.subheader("Error: Unable to get response. Please try again later.")
|
|
|
|
|
|
|
|
|