Spaces:
Sleeping
Sleeping
lets see lets see
Browse files
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")
|