Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -152,6 +152,41 @@ def get_response(system_message, chat_history, user_text, max_new_tokens=512):
|
|
152 |
# β
Streamlit UI
|
153 |
st.title("π HAL - NASA AI Assistant")
|
154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
# β
Reset Chat Button
|
156 |
if st.sidebar.button("Reset Chat"):
|
157 |
st.session_state.chat_history = [{"role": "assistant", "content": "Hello! How can I assist you today?"}]
|
|
|
152 |
# β
Streamlit UI
|
153 |
st.title("π HAL - NASA AI Assistant")
|
154 |
|
155 |
+
# β
Justify all chatbot responses
|
156 |
+
st.markdown("""
|
157 |
+
<style>
|
158 |
+
.user-msg {
|
159 |
+
background-color: #696969;
|
160 |
+
color: white;
|
161 |
+
padding: 10px;
|
162 |
+
border-radius: 10px;
|
163 |
+
margin-bottom: 5px;
|
164 |
+
width: fit-content;
|
165 |
+
max-width: 80%;
|
166 |
+
text-align: justify; /* β
Justify text */
|
167 |
+
}
|
168 |
+
.assistant-msg {
|
169 |
+
background-color: #333333;
|
170 |
+
color: white;
|
171 |
+
padding: 10px;
|
172 |
+
border-radius: 10px;
|
173 |
+
margin-bottom: 5px;
|
174 |
+
width: fit-content;
|
175 |
+
max-width: 80%;
|
176 |
+
text-align: justify; /* β
Justify text */
|
177 |
+
}
|
178 |
+
.container {
|
179 |
+
display: flex;
|
180 |
+
flex-direction: column;
|
181 |
+
align-items: flex-start;
|
182 |
+
}
|
183 |
+
@media (max-width: 600px) {
|
184 |
+
.user-msg, .assistant-msg { font-size: 16px; max-width: 100%; }
|
185 |
+
}
|
186 |
+
</style>
|
187 |
+
""", unsafe_allow_html=True)
|
188 |
+
|
189 |
+
|
190 |
# β
Reset Chat Button
|
191 |
if st.sidebar.button("Reset Chat"):
|
192 |
st.session_state.chat_history = [{"role": "assistant", "content": "Hello! How can I assist you today?"}]
|