JVice commited on
Commit
2fe7ca1
1 Parent(s): 3607a6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -12,9 +12,9 @@ import yaml
12
  from yaml.loader import SafeLoader
13
  from PIL import Image
14
  import os
15
- from huggingface_hub import CommitScheduler, login
16
 
17
- login(token=os.environ.get("HF_TOKEN"), write_permission=True)
18
 
19
 
20
  AUTHENTICATOR = None
@@ -83,9 +83,9 @@ def user_login_create():
83
  global TBYB_LOGO
84
  global USER_LOGGED_IN
85
  users = None
86
- with USER_DATABASE_UPDATE_SCHEDULER.lock:
87
- with USER_DATABASE_PATH.open('r') as file:
88
- # with open(USER_DATABASE_PATH) as file:
89
  users = yaml.load(file, Loader=SafeLoader)
90
  AUTHENTICATOR = stauth.Authenticate(
91
  users['credentials'],
 
12
  from yaml.loader import SafeLoader
13
  from PIL import Image
14
  import os
15
+ from huggingface_hub import CommitScheduler, login, snapshot_download
16
 
17
+ login(token=os.environ.get("HF_TOKEN"), write_permission=True, read_permission=True)
18
 
19
 
20
  AUTHENTICATOR = None
 
83
  global TBYB_LOGO
84
  global USER_LOGGED_IN
85
  users = None
86
+ snapshot_download(repo_id='JVice/try-before-you-bias-data',repo_type='dataset',local_dir='user_data')
87
+ newPath = 'user_data/data/user_database.yaml'
88
+ with open(newPath) as file:
89
  users = yaml.load(file, Loader=SafeLoader)
90
  AUTHENTICATOR = stauth.Authenticate(
91
  users['credentials'],