Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -190,6 +190,32 @@ def main():
|
|
190 |
}
|
191 |
</style>
|
192 |
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
|
194 |
# Sidebar
|
195 |
st.sidebar.title("About Citizens Information Chatbot")
|
@@ -225,13 +251,7 @@ def main():
|
|
225 |
combine_docs_chain_kwargs={"prompt": qa_prompt})
|
226 |
|
227 |
|
228 |
-
|
229 |
-
facebook_icon = get_image_base64("facebook.png")
|
230 |
-
twitter_icon = get_image_base64("twitter.png")
|
231 |
-
linkedin_icon = get_image_base64("linkedin.png")
|
232 |
-
instagram_icon = get_image_base64("Instagram.png")
|
233 |
-
ci_icon = get_image_base64("ci.png")
|
234 |
-
user_2_icon = get_image_base64("user_2.png")
|
235 |
|
236 |
# HTML for social media links with base64-encoded images
|
237 |
social_media_html = f"""
|
@@ -419,7 +439,7 @@ def main():
|
|
419 |
st.markdown(f"""
|
420 |
<div style="display: flex; justify-content: flex-end; align-items: flex-start; margin-bottom: 20px;">
|
421 |
<span style="margin-right: 10px;">{question}</span>
|
422 |
-
<img src='data:image/png;base64,{
|
423 |
</div>
|
424 |
""", unsafe_allow_html=True)
|
425 |
|
|
|
190 |
}
|
191 |
</style>
|
192 |
""", unsafe_allow_html=True)
|
193 |
+
|
194 |
+
# Base64-encoded images
|
195 |
+
facebook_icon = get_image_base64("facebook.png")
|
196 |
+
twitter_icon = get_image_base64("twitter.png")
|
197 |
+
linkedin_icon = get_image_base64("linkedin.png")
|
198 |
+
instagram_icon = get_image_base64("Instagram.png")
|
199 |
+
ci_icon = get_image_base64("ci.png")
|
200 |
+
avatar_1 = get_image_base64("avatar_2.png")
|
201 |
+
avatar_2 = get_image_base64("avatar_2.png")
|
202 |
+
avatar_3 = get_image_base64("avatar_3.png")
|
203 |
+
|
204 |
+
|
205 |
+
# Avatar options (for example purposes, replace these with your actual avatars)
|
206 |
+
avatar_options = {
|
207 |
+
"Avatar 1": "avatar_1",
|
208 |
+
"Avatar 2": "avatar_2",
|
209 |
+
"Avatar 3": "avatar_3"
|
210 |
+
}
|
211 |
+
|
212 |
+
# Sidebar for selecting avatar
|
213 |
+
selected_avatar = st.sidebar.radio("Choose an avatar", list(avatar_options.keys()))
|
214 |
+
|
215 |
+
# Store the selected avatar in session state
|
216 |
+
st.session_state.user_selected_avatar = avatar_options[selected_avatar]
|
217 |
+
|
218 |
+
|
219 |
|
220 |
# Sidebar
|
221 |
st.sidebar.title("About Citizens Information Chatbot")
|
|
|
251 |
combine_docs_chain_kwargs={"prompt": qa_prompt})
|
252 |
|
253 |
|
254 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
|
256 |
# HTML for social media links with base64-encoded images
|
257 |
social_media_html = f"""
|
|
|
439 |
st.markdown(f"""
|
440 |
<div style="display: flex; justify-content: flex-end; align-items: flex-start; margin-bottom: 20px;">
|
441 |
<span style="margin-right: 10px;">{question}</span>
|
442 |
+
<img src='data:image/png;base64,{st.session_state.user_selected_avatar}' style='width: 50px; height: 50px;'>
|
443 |
</div>
|
444 |
""", unsafe_allow_html=True)
|
445 |
|