osbm commited on
Commit
ffed18a
·
1 Parent(s): 181e118

lets see lets see

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -74,6 +74,9 @@ def update_vote(
74
  # fetch file and save it to the labels folder
75
  file_path = f"labels/{voter}.csv"
76
  req = requests.get(url)
 
 
 
77
  with open(file_path, "wb") as file:
78
  file.write(req.content)
79
 
@@ -126,7 +129,7 @@ if submitted or st.session_state['loggedin'] == 'true':
126
  st.session_state['loggedin'] = 'true'
127
 
128
 
129
- with st.form("images"):
130
  image_path = get_one_from_queue(username)
131
  if not image_path:
132
  st.write("You have voted for all the images")
 
74
  # fetch file and save it to the labels folder
75
  file_path = f"labels/{voter}.csv"
76
  req = requests.get(url)
77
+ # delete the file if it exists
78
+ if os.path.exists(file_path):
79
+ os.remove(file_path)
80
  with open(file_path, "wb") as file:
81
  file.write(req.content)
82
 
 
129
  st.session_state['loggedin'] = 'true'
130
 
131
 
132
+ with st.form("images", clear_on_submit=True):
133
  image_path = get_one_from_queue(username)
134
  if not image_path:
135
  st.write("You have voted for all the images")