Spaces:
Sleeping
Sleeping
Update pages/deep_learning.py
Browse files- 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
|
| 48 |
-
st.session_state
|
| 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
|
| 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("---")
|