From 583164adc31f0c4038e5441efe6e70bdf866de0a Mon Sep 17 00:00:00 2001 From: Teriks Date: Sun, 12 Jan 2025 22:21:06 -0600 Subject: [PATCH] allow passing hf_token to load_textual_inversion --- src/diffusers/loaders/textual_inversion.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/diffusers/loaders/textual_inversion.py b/src/diffusers/loaders/textual_inversion.py index 095d154cb4fe..e756bb5d4956 100644 --- a/src/diffusers/loaders/textual_inversion.py +++ b/src/diffusers/loaders/textual_inversion.py @@ -40,7 +40,7 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs) force_download = kwargs.pop("force_download", False) proxies = kwargs.pop("proxies", 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) subfolder = kwargs.pop("subfolder", None) weight_name = kwargs.pop("weight_name", None) @@ -73,7 +73,7 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs) force_download=force_download, proxies=proxies, local_files_only=local_files_only, - token=token, + token=hf_token, revision=revision, subfolder=subfolder, user_agent=user_agent, @@ -93,7 +93,7 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs) force_download=force_download, proxies=proxies, local_files_only=local_files_only, - token=token, + token=hf_token, revision=revision, subfolder=subfolder, user_agent=user_agent, @@ -312,7 +312,7 @@ def load_textual_inversion( 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 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 `diffusers-cli login` (stored in `~/.huggingface`) is used. revision (`str`, *optional*, defaults to `"main"`):