Spaces:
Sleeping
Sleeping
Update pages/machine_learning.py
Browse files
pages/machine_learning.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
import os
|
| 3 |
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
|
| 4 |
from langchain_core.messages import HumanMessage, AIMessage, SystemMessage
|
|
@@ -73,7 +74,7 @@ try:
|
|
| 73 |
result = deep_seek.invoke(messages)
|
| 74 |
|
| 75 |
# Append to history
|
| 76 |
-
st.session_state[PAGE_KEY].append((user_input, result.content))
|
| 77 |
|
| 78 |
# --- Display Chat History ---
|
| 79 |
st.subheader("🗨️ Chat History")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import re
|
| 3 |
import os
|
| 4 |
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
|
| 5 |
from langchain_core.messages import HumanMessage, AIMessage, SystemMessage
|
|
|
|
| 74 |
result = deep_seek.invoke(messages)
|
| 75 |
|
| 76 |
# Append to history
|
| 77 |
+
st.session_state[PAGE_KEY].append((user_input, re.findall('<think>.*</think>',result.content,flags = re.DOTALL)))
|
| 78 |
|
| 79 |
# --- Display Chat History ---
|
| 80 |
st.subheader("🗨️ Chat History")
|