CCockrum commited on
Commit
f8490df
Β·
verified Β·
1 Parent(s): 74bfc30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -103,7 +103,6 @@ def generate_follow_up(user_text):
103
 
104
  return cleaned_output
105
 
106
- # βœ… Main Response Function
107
  # βœ… Main Response Function
108
  def get_response(system_message, user_text, max_new_tokens=800):
109
  """
@@ -207,6 +206,16 @@ if st.sidebar.button("Reset Chat"):
207
  st.session_state.response_ready = False
208
  st.session_state.follow_up = ""
209
 
 
 
 
 
 
 
 
 
 
 
210
  # βœ… Chat UI
211
  user_input = st.chat_input("Type your message here...")
212
 
 
103
 
104
  return cleaned_output
105
 
 
106
  # βœ… Main Response Function
107
  def get_response(system_message, user_text, max_new_tokens=800):
108
  """
 
206
  st.session_state.response_ready = False
207
  st.session_state.follow_up = ""
208
 
209
+ # βœ… Display Chat History
210
+ st.markdown("<div class='container'>", unsafe_allow_html=True)
211
+ for message in st.session_state.chat_history:
212
+ if message["role"] == "user":
213
+ st.markdown(f"<div class='user-msg'><strong>You:</strong> {message['content']}</div>", unsafe_allow_html=True)
214
+ else:
215
+ st.markdown(f"<div class='assistant-msg'><strong>HAL:</strong> {message['content']}</div>", unsafe_allow_html=True)
216
+ st.markdown("</div>", unsafe_allow_html=True)
217
+
218
+
219
  # βœ… Chat UI
220
  user_input = st.chat_input("Type your message here...")
221