Spaces:
Sleeping
Sleeping
remove comments
Browse files
app.py
CHANGED
@@ -17,6 +17,8 @@ voters = [
|
|
17 |
"volunteer-5",
|
18 |
]
|
19 |
|
|
|
|
|
20 |
# login page
|
21 |
with st.form("login"):
|
22 |
username = st.selectbox("Select voter", voters)
|
@@ -25,9 +27,6 @@ with st.form("login"):
|
|
25 |
|
26 |
|
27 |
def get_list_of_images():
|
28 |
-
# fs = hfh.HfFileSystem(token=os.environ.get("hf_token"))
|
29 |
-
# return fs.ls("datasets/aifred-smart-life-coach/capstone-images", detail=False, refresh=True)
|
30 |
-
api = hfh.HfApi()
|
31 |
files = api.list_repo_tree(repo_id="aifred-smart-life-coach/capstone-images", repo_type="dataset", recursive=True,)
|
32 |
files = [file.path for file in files if file.path.endswith((".png", ".jpg"))]
|
33 |
return files
|
@@ -35,10 +34,9 @@ def get_list_of_images():
|
|
35 |
|
36 |
def get_one_from_queue(voter: str):
|
37 |
# get an image for the voter or return False if no image is left
|
|
|
38 |
return None
|
39 |
-
|
40 |
-
st.write(result)
|
41 |
-
print(result)
|
42 |
|
43 |
if submitted:
|
44 |
if not password == os.environ.get("app_password"):
|
|
|
17 |
"volunteer-5",
|
18 |
]
|
19 |
|
20 |
+
api = hfh.HfApi(token=os.environ.get("hf_token"))
|
21 |
+
|
22 |
# login page
|
23 |
with st.form("login"):
|
24 |
username = st.selectbox("Select voter", voters)
|
|
|
27 |
|
28 |
|
29 |
def get_list_of_images():
|
|
|
|
|
|
|
30 |
files = api.list_repo_tree(repo_id="aifred-smart-life-coach/capstone-images", repo_type="dataset", recursive=True,)
|
31 |
files = [file.path for file in files if file.path.endswith((".png", ".jpg"))]
|
32 |
return files
|
|
|
34 |
|
35 |
def get_one_from_queue(voter: str):
|
36 |
# get an image for the voter or return False if no image is left
|
37 |
+
|
38 |
return None
|
39 |
+
|
|
|
|
|
40 |
|
41 |
if submitted:
|
42 |
if not password == os.environ.get("app_password"):
|