1MR commited on
Commit
202a39d
·
verified ·
1 Parent(s): 603fb2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -118,9 +118,11 @@ def handle_userinput(user_question):
118
  # Display the chat history
119
  for message in st.session_state.chat_history:
120
  if message["role"] == "user":
121
- st.write(f"<div style='color: white;background-red: lightgray; padding: 0 1.5rem; border-radius: 50%;'>User: {message['content']}</div>", unsafe_allow_html=True)
 
122
  else:
123
- st.write(f"<div style='color: white;background-color: blue; padding: 0 1.5rem; border-radius: 50%;'>Bot: {message['content']}</div>", unsafe_allow_html=True)
 
124
 
125
  # for i, message in enumerate(st.session_state.chat_history):
126
  # if i % 2 == 0:
 
118
  # Display the chat history
119
  for message in st.session_state.chat_history:
120
  if message["role"] == "user":
121
+ st.write(user_template.replace("{{MSG}}", message['content']), unsafe_allow_html=True)
122
+ # st.write(f"<div style='color: white;background-red: lightgray; padding: 0 1.5rem; border-radius: 50%;'>User: {message['content']}</div>", unsafe_allow_html=True)
123
  else:
124
+ st.write(bot_template.replace("{{MSG}}", message['content']), unsafe_allow_html=True)
125
+ # st.write(f"<div style='color: white;background-color: blue; padding: 0 1.5rem; border-radius: 50%;'>Bot: {message['content']}</div>", unsafe_allow_html=True)
126
 
127
  # for i, message in enumerate(st.session_state.chat_history):
128
  # if i % 2 == 0: