Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -165,6 +165,24 @@ def get_response(system_message, user_text, max_new_tokens=800):
|
|
| 165 |
# β
Streamlit UI
|
| 166 |
st.title("π HAL - NASA AI Assistant")
|
| 167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
# β
Display Chat History
|
| 169 |
st.markdown("<div class='container'>", unsafe_allow_html=True)
|
| 170 |
for message in st.session_state.chat_history:
|
|
|
|
| 165 |
# β
Streamlit UI
|
| 166 |
st.title("π HAL - NASA AI Assistant")
|
| 167 |
|
| 168 |
+
# β
Justify all chatbot responses
|
| 169 |
+
st.markdown("""
|
| 170 |
+
<style>
|
| 171 |
+
.user-msg, .assistant-msg {
|
| 172 |
+
padding: 10px;
|
| 173 |
+
border-radius: 10px;
|
| 174 |
+
margin-bottom: 5px;
|
| 175 |
+
width: fit-content;
|
| 176 |
+
max-width: 80%;
|
| 177 |
+
text-align: justify;
|
| 178 |
+
}
|
| 179 |
+
.user-msg { background-color: #696969; color: white; }
|
| 180 |
+
.assistant-msg { background-color: #333333; color: white; }
|
| 181 |
+
.container { display: flex; flex-direction: column; align-items: flex-start; }
|
| 182 |
+
@media (max-width: 600px) { .user-msg, .assistant-msg { font-size: 16px; max-width: 100%; } }
|
| 183 |
+
</style>
|
| 184 |
+
""", unsafe_allow_html=True)
|
| 185 |
+
|
| 186 |
# β
Display Chat History
|
| 187 |
st.markdown("<div class='container'>", unsafe_allow_html=True)
|
| 188 |
for message in st.session_state.chat_history:
|