Update app.py
Browse files
app.py
CHANGED
@@ -181,8 +181,6 @@ with input_container:
|
|
181 |
# Play the speech
|
182 |
st.audio(speech_fp, format='audio/mp3')
|
183 |
|
184 |
-
# Define a container to display the conversation history
|
185 |
-
conversation_history_container = st.container()
|
186 |
|
187 |
# Check if there are generated responses to display
|
188 |
if st.session_state['generated']:
|
@@ -196,22 +194,6 @@ else:
|
|
196 |
if not st.session_state['past']:
|
197 |
st.markdown("I'm your Mental health Assistant, How may I help you?")
|
198 |
|
199 |
-
# Get the latest user message if available
|
200 |
-
if st.session_state.get('entered_text'):
|
201 |
-
user_message = st.session_state.entered_text[-1]
|
202 |
-
else:
|
203 |
-
user_message = None
|
204 |
-
|
205 |
-
# Get the latest AI response if available
|
206 |
-
response = st.session_state['generated'][-1] if st.session_state['generated'] else None
|
207 |
-
|
208 |
-
# Update the conversation history with the new messages
|
209 |
-
with conversation_history_container:
|
210 |
-
if user_message:
|
211 |
-
message(user_message, is_user=True)
|
212 |
-
if response:
|
213 |
-
message(response)
|
214 |
-
|
215 |
|
216 |
|
217 |
with st.sidebar.expander("Sentiment Analysis"):
|
|
|
181 |
# Play the speech
|
182 |
st.audio(speech_fp, format='audio/mp3')
|
183 |
|
|
|
|
|
184 |
|
185 |
# Check if there are generated responses to display
|
186 |
if st.session_state['generated']:
|
|
|
194 |
if not st.session_state['past']:
|
195 |
st.markdown("I'm your Mental health Assistant, How may I help you?")
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
|
199 |
with st.sidebar.expander("Sentiment Analysis"):
|