awacke1 commited on
Commit
9dac053
β€’
1 Parent(s): b1ad51c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -22,12 +22,12 @@ def display_images(image_dir):
22
 
23
  with col1:
24
  st.image(os.path.join(image_dir, image1))
25
- if st.button(f"Upvote {image1}"):
26
  handle_vote(image1)
27
 
28
  with col2:
29
  st.image(os.path.join(image_dir, image2))
30
- if st.button(f"Upvote {image2}"):
31
  handle_vote(image2)
32
 
33
  # 🎯 2. Handle the voting logic and store the history
 
22
 
23
  with col1:
24
  st.image(os.path.join(image_dir, image1))
25
+ if st.button(f"Upvote {image1}", key=f"upvote_{image1}"): # Use image filename as key
26
  handle_vote(image1)
27
 
28
  with col2:
29
  st.image(os.path.join(image_dir, image2))
30
+ if st.button(f"Upvote {image2}", key=f"upvote_{image2}"): # Use image filename as key
31
  handle_vote(image2)
32
 
33
  # 🎯 2. Handle the voting logic and store the history