Clone77 commited on
Commit
2ef66f2
·
verified ·
1 Parent(s): 7ce70e6

Update pages/deep_learning.py

Browse files
Files changed (1) hide show
  1. pages/deep_learning.py +8 -4
pages/deep_learning.py CHANGED
@@ -42,10 +42,10 @@ deep_seek = ChatHuggingFace(
42
  max_new_tokens=150,
43
  task='conversational'
44
  )
45
-
46
  # --- Session State ---
47
- if "chat_history" not in st.session_state:
48
- st.session_state.chat_history = []
49
 
50
  # --- Chat Form ---
51
  with st.form(key="chat_form"):
@@ -68,7 +68,11 @@ if submit and user_input:
68
 
69
  # --- Display Chat History ---
70
  st.subheader("🗨️ Chat History")
71
- for i, (user, bot) in enumerate(st.session_state.chat_history):
72
  st.markdown(f"**You:** {user}")
73
  st.markdown(f"**Mentor:** {bot}")
74
  st.markdown("---")
 
 
 
 
 
42
  max_new_tokens=150,
43
  task='conversational'
44
  )
45
+ PAGE_KEY = "deep_learning_chat_history"
46
  # --- Session State ---
47
+ if PAGE_KEY not in st.session_state:
48
+ st.session_state[PAGE_KEY] = []
49
 
50
  # --- Chat Form ---
51
  with st.form(key="chat_form"):
 
68
 
69
  # --- Display Chat History ---
70
  st.subheader("🗨️ Chat History")
71
+ for user, bot in st.session_state[PAGE_KEY]:
72
  st.markdown(f"**You:** {user}")
73
  st.markdown(f"**Mentor:** {bot}")
74
  st.markdown("---")
75
+ # for i, (user, bot) in enumerate(st.session_state.chat_history):
76
+ # st.markdown(f"**You:** {user}")
77
+ # st.markdown(f"**Mentor:** {bot}")
78
+ # st.markdown("---")