mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
use access token
This commit is contained in:
@@ -39,7 +39,7 @@ def huggingface_upload(
|
|||||||
private = args.huggingface_repo_visibility == "private"
|
private = args.huggingface_repo_visibility == "private"
|
||||||
api = HfApi()
|
api = HfApi()
|
||||||
if not huggingface_exists_repo(
|
if not huggingface_exists_repo(
|
||||||
repo_id=repo_id, repo_type=repo_type, hf_token=hf_token
|
repo_id=repo_id, repo_type=repo_type, token=hf_token
|
||||||
):
|
):
|
||||||
api.create_repo(
|
api.create_repo(
|
||||||
token=hf_token, repo_id=repo_id, repo_type=repo_type, private=private
|
token=hf_token, repo_id=repo_id, repo_type=repo_type, private=private
|
||||||
@@ -54,6 +54,7 @@ def huggingface_upload(
|
|||||||
repo_type=repo_type,
|
repo_type=repo_type,
|
||||||
folder_path=src,
|
folder_path=src,
|
||||||
path_in_repo=path_in_repo,
|
path_in_repo=path_in_repo,
|
||||||
|
token=hf_token,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
api.upload_file(
|
api.upload_file(
|
||||||
@@ -61,4 +62,5 @@ def huggingface_upload(
|
|||||||
repo_type=repo_type,
|
repo_type=repo_type,
|
||||||
path_or_fileobj=src,
|
path_or_fileobj=src,
|
||||||
path_in_repo=path_in_repo,
|
path_in_repo=path_in_repo,
|
||||||
|
token=hf_token,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user