Unverified Commit 6b727842 authored by Teriks's avatar Teriks Committed by GitHub
Browse files

allow passing hf_token to load_textual_inversion (#10546)


Co-authored-by: default avatarTeriks <Teriks@users.noreply.github.com>
parent be62c85c
...@@ -40,7 +40,7 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs) ...@@ -40,7 +40,7 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
local_files_only = kwargs.pop("local_files_only", None) local_files_only = kwargs.pop("local_files_only", None)
token = kwargs.pop("token", None) hf_token = kwargs.pop("hf_token", None)
revision = kwargs.pop("revision", None) revision = kwargs.pop("revision", None)
subfolder = kwargs.pop("subfolder", None) subfolder = kwargs.pop("subfolder", None)
weight_name = kwargs.pop("weight_name", None) weight_name = kwargs.pop("weight_name", None)
...@@ -73,7 +73,7 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs) ...@@ -73,7 +73,7 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs)
force_download=force_download, force_download=force_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=hf_token,
revision=revision, revision=revision,
subfolder=subfolder, subfolder=subfolder,
user_agent=user_agent, user_agent=user_agent,
...@@ -93,7 +93,7 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs) ...@@ -93,7 +93,7 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs)
force_download=force_download, force_download=force_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=hf_token,
revision=revision, revision=revision,
subfolder=subfolder, subfolder=subfolder,
user_agent=user_agent, user_agent=user_agent,
...@@ -312,7 +312,7 @@ class TextualInversionLoaderMixin: ...@@ -312,7 +312,7 @@ class TextualInversionLoaderMixin:
local_files_only (`bool`, *optional*, defaults to `False`): local_files_only (`bool`, *optional*, defaults to `False`):
Whether to only load local model weights and configuration files or not. If set to `True`, the model Whether to only load local model weights and configuration files or not. If set to `True`, the model
won't be downloaded from the Hub. won't be downloaded from the Hub.
token (`str` or *bool*, *optional*): hf_token (`str` or *bool*, *optional*):
The token to use as HTTP bearer authorization for remote files. If `True`, the token generated from The token to use as HTTP bearer authorization for remote files. If `True`, the token generated from
`diffusers-cli login` (stored in `~/.huggingface`) is used. `diffusers-cli login` (stored in `~/.huggingface`) is used.
revision (`str`, *optional*, defaults to `"main"`): revision (`str`, *optional*, defaults to `"main"`):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment