Clone77 commited on
Commit
0e22ff9
·
verified ·
1 Parent(s): 095b42c

Update pages/excel.py

Browse files
Files changed (1) hide show
  1. pages/excel.py +6 -4
pages/excel.py CHANGED
@@ -45,8 +45,10 @@ deep_seek = ChatHuggingFace(
45
  )
46
 
47
  # --- Session State ---
48
- if "chat_history" not in st.session_state:
49
- st.session_state.chat_history = []
 
 
50
 
51
  # --- Chat Form ---
52
  with st.form(key="chat_form"):
@@ -65,11 +67,11 @@ if submit and user_input:
65
  result = deep_seek.invoke(messages)
66
 
67
  # Append to history
68
- st.session_state.chat_history.append((user_input, result.content))
69
 
70
  # --- Display Chat History ---
71
  st.subheader("🗨️ Chat History")
72
- for i, (user, bot) in enumerate(st.session_state.chat_history):
73
  st.markdown(f"**You:** {user}")
74
  st.markdown(f"**Mentor:** {bot}")
75
  st.markdown("---")
 
45
  )
46
 
47
  # --- Session State ---
48
+ PAGE_KEY = "excel_chat_history"
49
+ # --- Session State ---
50
+ if PAGE_KEY not in st.session_state:
51
+ st.session_state[PAGE_KEY] = []
52
 
53
  # --- Chat Form ---
54
  with st.form(key="chat_form"):
 
67
  result = deep_seek.invoke(messages)
68
 
69
  # Append to history
70
+ st.session_state[PAGE_KEY].append((user_input, result.content))
71
 
72
  # --- Display Chat History ---
73
  st.subheader("🗨️ Chat History")
74
+ for user, bot in st.session_state[PAGE_KEY]:
75
  st.markdown(f"**You:** {user}")
76
  st.markdown(f"**Mentor:** {bot}")
77
  st.markdown("---")