AlanOC commited on
Commit
066ff07
1 Parent(s): ab09918

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -13
app.py CHANGED
@@ -202,18 +202,6 @@ def main():
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
 
@@ -239,7 +227,37 @@ def main():
239
  We can change the chatbot's information anytime without notice.
240
  <br><br>
241
  **Using this chatbot means you accept these terms. For more detailed advice, consult the <a href="https://www.citizensinformation.ie/" target="_blank">Citizens Information Website</a>**""", unsafe_allow_html=True)
242
- # Create a slider widget
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
 
244
  # Create a slider widget in the sidebar
245
  ai_temp = st.sidebar.slider("Select AI Temperature", min_value=0.0, max_value=1.0, value=0.7, step=0.1)
 
202
  avatar_3 = get_image_base64("avatar_3.png")
203
 
204
 
 
 
 
 
 
 
 
 
 
 
 
 
205
 
206
 
207
 
 
227
  We can change the chatbot's information anytime without notice.
228
  <br><br>
229
  **Using this chatbot means you accept these terms. For more detailed advice, consult the <a href="https://www.citizensinformation.ie/" target="_blank">Citizens Information Website</a>**""", unsafe_allow_html=True)
230
+
231
+
232
+ # Display avatars with selection option
233
+ st.sidebar.write("Choose an avatar:")
234
+
235
+ # Option 1
236
+ st.sidebar.image("path_to_avatar_1_image", width=50)
237
+ option1 = st.sidebar.radio("", ["Avatar 1"], key="1")
238
+
239
+ # Option 2
240
+ st.sidebar.image("path_to_avatar_2_image", width=50)
241
+ option2 = st.sidebar.radio("", ["Avatar 2"], key="2")
242
+
243
+ # Option 3
244
+ st.sidebar.image("path_to_avatar_3_image", width=50)
245
+ option3 = st.sidebar.radio("", ["Avatar 3"], key="3")
246
+
247
+ # Logic to determine which avatar is selected
248
+ selected_avatar = ""
249
+ if option1 == "Avatar 1":
250
+ selected_avatar = avatar_1
251
+ elif option2 == "Avatar 2":
252
+ selected_avatar = avatar_2
253
+ elif option3 == "Avatar 3":
254
+ selected_avatar = avatar_3
255
+
256
+ # Store the selected avatar in session state
257
+ st.session_state.user_selected_avatar = selected_avatar
258
+
259
+
260
+
261
 
262
  # Create a slider widget in the sidebar
263
  ai_temp = st.sidebar.slider("Select AI Temperature", min_value=0.0, max_value=1.0, value=0.7, step=0.1)