CCockrum commited on
Commit
79b8723
·
verified ·
1 Parent(s): ffc1c71

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -85,8 +85,9 @@ def get_response(system_message, chat_history, user_text, max_new_tokens=800):
85
  response = "I'm sorry, but I couldn't generate a response. Can you rephrase your question?"
86
 
87
  # ✅ Preserve conversation history
88
- st.session_state.chat_history.append({'role': 'user', 'content': user_text})
89
- st.session_state.chat_history.append({'role': 'assistant', 'content': response})
 
90
 
91
  return response, st.session_state.chat_history
92
 
 
85
  response = "I'm sorry, but I couldn't generate a response. Can you rephrase your question?"
86
 
87
  # ✅ Preserve conversation history
88
+ chat_history.append({'role': 'user', 'content': user_text})
89
+ chat_history.append({'role': 'assistant', 'content': response})
90
+ st.session_state.chat_history = chat_history # ✅ Update session state history
91
 
92
  return response, st.session_state.chat_history
93