multimodalart HF staff commited on
Commit
a114ce6
1 Parent(s): d8f7af3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -299,7 +299,7 @@ def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuth
299
  os.makedirs(folder, exist_ok=False)
300
  info, downloaded_files = process_url(url, profile, folder=folder)
301
  try:
302
- api = HfApi(token=os.environ["HUGGING_FACE_HUB_TOKEN"])
303
  username = api.whoami()["name"]
304
  slug_name = slugify(info["name"])
305
  except:
@@ -309,6 +309,7 @@ def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuth
309
  try:
310
  #repo_id = f"{username}/{profile.preferred_username}-{slug_name}"
311
  print("Creating repo...")
 
312
  api.create_repo(repo_id=user_repo_id, private=True, exist_ok=True)
313
  print("Uploading repo...")
314
  api.upload_folder(
 
299
  os.makedirs(folder, exist_ok=False)
300
  info, downloaded_files = process_url(url, profile, folder=folder)
301
  try:
302
+ api = HfApi(token=oauth_token)
303
  username = api.whoami()["name"]
304
  slug_name = slugify(info["name"])
305
  except:
 
309
  try:
310
  #repo_id = f"{username}/{profile.preferred_username}-{slug_name}"
311
  print("Creating repo...")
312
+ print(user_repo_id)
313
  api.create_repo(repo_id=user_repo_id, private=True, exist_ok=True)
314
  print("Uploading repo...")
315
  api.upload_folder(