multimodalart HF staff commited on
Commit
f14adde
1 Parent(s): a86c72a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -331,7 +331,7 @@ def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuth
331
 
332
  folder = str(uuid.uuid4())
333
  os.makedirs(folder, exist_ok=False)
334
- gr.Info(f"Model {info['name']} found, starting download...")
335
  info, downloaded_files = process_url(url, profile, folder=folder)
336
  username = {profile.username}
337
  slug_name = slugify(info["name"])
@@ -339,7 +339,7 @@ def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuth
339
  create_readme(info, downloaded_files, user_repo_id, link_civit, folder=folder)
340
  try:
341
  create_repo(repo_id=user_repo_id, private=True, exist_ok=True, token=oauth_token.token)
342
- gr.Info("Starting to upload repo to Hugging Face...")
343
  upload_folder(
344
  folder_path=folder,
345
  repo_id=user_repo_id,
@@ -347,7 +347,7 @@ def upload_civit_to_hf(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuth
347
  token=oauth_token.token
348
  )
349
  update_repo_visibility(repo_id=user_repo_id, private=False, token=oauth_token.token)
350
- gr.Info(f"Model {user_repo_id} uploaded!")
351
  except Exception as e:
352
  print(e)
353
  raise gr.Error("Your Hugging Face Token expired. Log out and in again to upload your models.")
@@ -365,8 +365,7 @@ def bulk_upload(profile: Optional[gr.OAuthProfile], oauth_token: gr.OAuthToken,
365
  upload_result = upload_civit_to_hf(profile, oauth_token, url, link_civit)
366
  upload_results += upload_result+"\n"
367
  except Exception as e:
368
- print(e)
369
- gr.Warning(f"Error uploading the model {link_civit}")
370
  return upload_results
371
 
372
  css = '''
 
331
 
332
  folder = str(uuid.uuid4())
333
  os.makedirs(folder, exist_ok=False)
334
+ gr.Info(f"Starting download of model {url}")
335
  info, downloaded_files = process_url(url, profile, folder=folder)
336
  username = {profile.username}
337
  slug_name = slugify(info["name"])
 
339
  create_readme(info, downloaded_files, user_repo_id, link_civit, folder=folder)
340
  try:
341
  create_repo(repo_id=user_repo_id, private=True, exist_ok=True, token=oauth_token.token)
342
+ gr.Info(f"Starting to upload repo {user_repo_id} to Hugging Face...")
343
  upload_folder(
344
  folder_path=folder,
345
  repo_id=user_repo_id,
 
347
  token=oauth_token.token
348
  )
349
  update_repo_visibility(repo_id=user_repo_id, private=False, token=oauth_token.token)
350
+ gr.Info(f"Model uploaded!")
351
  except Exception as e:
352
  print(e)
353
  raise gr.Error("Your Hugging Face Token expired. Log out and in again to upload your models.")
 
365
  upload_result = upload_civit_to_hf(profile, oauth_token, url, link_civit)
366
  upload_results += upload_result+"\n"
367
  except Exception as e:
368
+ gr.Warning(f"Error uploading the model {url}")
 
369
  return upload_results
370
 
371
  css = '''