multimodalart HF staff commited on
Commit
acea27c
·
1 Parent(s): 833284d

Update uploader.py

Browse files
Files changed (1) hide show
  1. uploader.py +2 -4
uploader.py CHANGED
@@ -16,7 +16,7 @@ class Uploader:
16
  delete_existing_repo: bool = False,
17
  input_token: str | None = None) -> str:
18
 
19
- api = HfAPi(token=self.hf_token if self.hf_token else input_token)
20
 
21
  if not folder_path:
22
  raise ValueError
@@ -31,9 +31,7 @@ class Uploader:
31
  self.api.delete_repo(repo_id, repo_type=repo_type)
32
  except Exception:
33
  pass
34
- try:
35
- api = HfApi(token=self.hf_token if self.hf_token else input_token)
36
-
37
  api.create_repo(repo_id, repo_type=repo_type, private=private)
38
  api.upload_folder(repo_id=repo_id,
39
  folder_path=folder_path,
 
16
  delete_existing_repo: bool = False,
17
  input_token: str | None = None) -> str:
18
 
19
+ api = HfApi(token=self.hf_token if self.hf_token else input_token)
20
 
21
  if not folder_path:
22
  raise ValueError
 
31
  self.api.delete_repo(repo_id, repo_type=repo_type)
32
  except Exception:
33
  pass
34
+ try:
 
 
35
  api.create_repo(repo_id, repo_type=repo_type, private=private)
36
  api.upload_folder(repo_id=repo_id,
37
  folder_path=folder_path,