Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -103,7 +103,6 @@ def generate_follow_up(user_text):
|
|
103 |
|
104 |
return cleaned_output
|
105 |
|
106 |
-
# β
Main Response Function
|
107 |
# β
Main Response Function
|
108 |
def get_response(system_message, user_text, max_new_tokens=800):
|
109 |
"""
|
@@ -207,6 +206,16 @@ if st.sidebar.button("Reset Chat"):
|
|
207 |
st.session_state.response_ready = False
|
208 |
st.session_state.follow_up = ""
|
209 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
# β
Chat UI
|
211 |
user_input = st.chat_input("Type your message here...")
|
212 |
|
|
|
103 |
|
104 |
return cleaned_output
|
105 |
|
|
|
106 |
# β
Main Response Function
|
107 |
def get_response(system_message, user_text, max_new_tokens=800):
|
108 |
"""
|
|
|
206 |
st.session_state.response_ready = False
|
207 |
st.session_state.follow_up = ""
|
208 |
|
209 |
+
# β
Display Chat History
|
210 |
+
st.markdown("<div class='container'>", unsafe_allow_html=True)
|
211 |
+
for message in st.session_state.chat_history:
|
212 |
+
if message["role"] == "user":
|
213 |
+
st.markdown(f"<div class='user-msg'><strong>You:</strong> {message['content']}</div>", unsafe_allow_html=True)
|
214 |
+
else:
|
215 |
+
st.markdown(f"<div class='assistant-msg'><strong>HAL:</strong> {message['content']}</div>", unsafe_allow_html=True)
|
216 |
+
st.markdown("</div>", unsafe_allow_html=True)
|
217 |
+
|
218 |
+
|
219 |
# β
Chat UI
|
220 |
user_input = st.chat_input("Type your message here...")
|
221 |
|