Unverified Commit e02ec27e authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[Core] remove `resume_download` from Hub related stuff (#8648)

* remove resume_download

* fix: _fetch_index_file call.

* remove resume_download from docs.
parent a41e4c50
...@@ -71,7 +71,7 @@ class CheckpointMergerPipeline(DiffusionPipeline): ...@@ -71,7 +71,7 @@ class CheckpointMergerPipeline(DiffusionPipeline):
**kwargs: **kwargs:
Supports all the default DiffusionPipeline.get_config_dict kwargs viz.. Supports all the default DiffusionPipeline.get_config_dict kwargs viz..
cache_dir, resume_download, force_download, proxies, local_files_only, token, revision, torch_dtype, device_map. cache_dir, force_download, proxies, local_files_only, token, revision, torch_dtype, device_map.
alpha - The interpolation parameter. Ranges from 0 to 1. It affects the ratio in which the checkpoints are merged. A 0.8 alpha alpha - The interpolation parameter. Ranges from 0 to 1. It affects the ratio in which the checkpoints are merged. A 0.8 alpha
would mean that the first model checkpoints would affect the final result far less than an alpha of 0.2 would mean that the first model checkpoints would affect the final result far less than an alpha of 0.2
...@@ -86,7 +86,6 @@ class CheckpointMergerPipeline(DiffusionPipeline): ...@@ -86,7 +86,6 @@ class CheckpointMergerPipeline(DiffusionPipeline):
""" """
# Default kwargs from DiffusionPipeline # Default kwargs from DiffusionPipeline
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
resume_download = kwargs.pop("resume_download", False)
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", False) local_files_only = kwargs.pop("local_files_only", False)
...@@ -124,7 +123,6 @@ class CheckpointMergerPipeline(DiffusionPipeline): ...@@ -124,7 +123,6 @@ class CheckpointMergerPipeline(DiffusionPipeline):
config_dict = DiffusionPipeline.load_config( config_dict = DiffusionPipeline.load_config(
pretrained_model_name_or_path, pretrained_model_name_or_path,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
force_download=force_download, force_download=force_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
...@@ -160,7 +158,6 @@ class CheckpointMergerPipeline(DiffusionPipeline): ...@@ -160,7 +158,6 @@ class CheckpointMergerPipeline(DiffusionPipeline):
else snapshot_download( else snapshot_download(
pretrained_model_name_or_path, pretrained_model_name_or_path,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -267,7 +267,6 @@ class IPAdapterFaceIDStableDiffusionPipeline( ...@@ -267,7 +267,6 @@ class IPAdapterFaceIDStableDiffusionPipeline(
def load_ip_adapter_face_id(self, pretrained_model_name_or_path_or_dict, weight_name, **kwargs): def load_ip_adapter_face_id(self, pretrained_model_name_or_path_or_dict, weight_name, **kwargs):
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_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) token = kwargs.pop("token", None)
...@@ -283,7 +282,6 @@ class IPAdapterFaceIDStableDiffusionPipeline( ...@@ -283,7 +282,6 @@ class IPAdapterFaceIDStableDiffusionPipeline(
weights_name=weight_name, weights_name=weight_name,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -783,7 +783,6 @@ class TensorRTStableDiffusionImg2ImgPipeline(StableDiffusionImg2ImgPipeline): ...@@ -783,7 +783,6 @@ class TensorRTStableDiffusionImg2ImgPipeline(StableDiffusionImg2ImgPipeline):
@validate_hf_hub_args @validate_hf_hub_args
def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs): def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs):
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
resume_download = kwargs.pop("resume_download", False)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
local_files_only = kwargs.pop("local_files_only", False) local_files_only = kwargs.pop("local_files_only", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
...@@ -795,7 +794,6 @@ class TensorRTStableDiffusionImg2ImgPipeline(StableDiffusionImg2ImgPipeline): ...@@ -795,7 +794,6 @@ class TensorRTStableDiffusionImg2ImgPipeline(StableDiffusionImg2ImgPipeline):
else snapshot_download( else snapshot_download(
pretrained_model_name_or_path, pretrained_model_name_or_path,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -783,7 +783,6 @@ class TensorRTStableDiffusionInpaintPipeline(StableDiffusionInpaintPipeline): ...@@ -783,7 +783,6 @@ class TensorRTStableDiffusionInpaintPipeline(StableDiffusionInpaintPipeline):
@validate_hf_hub_args @validate_hf_hub_args
def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs): def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs):
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
resume_download = kwargs.pop("resume_download", False)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
local_files_only = kwargs.pop("local_files_only", False) local_files_only = kwargs.pop("local_files_only", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
...@@ -795,7 +794,6 @@ class TensorRTStableDiffusionInpaintPipeline(StableDiffusionInpaintPipeline): ...@@ -795,7 +794,6 @@ class TensorRTStableDiffusionInpaintPipeline(StableDiffusionInpaintPipeline):
else snapshot_download( else snapshot_download(
pretrained_model_name_or_path, pretrained_model_name_or_path,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -695,7 +695,6 @@ class TensorRTStableDiffusionPipeline(StableDiffusionPipeline): ...@@ -695,7 +695,6 @@ class TensorRTStableDiffusionPipeline(StableDiffusionPipeline):
@validate_hf_hub_args @validate_hf_hub_args
def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs): def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs):
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
resume_download = kwargs.pop("resume_download", False)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
local_files_only = kwargs.pop("local_files_only", False) local_files_only = kwargs.pop("local_files_only", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
...@@ -707,7 +706,6 @@ class TensorRTStableDiffusionPipeline(StableDiffusionPipeline): ...@@ -707,7 +706,6 @@ class TensorRTStableDiffusionPipeline(StableDiffusionPipeline):
else snapshot_download( else snapshot_download(
pretrained_model_name_or_path, pretrained_model_name_or_path,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -310,9 +310,6 @@ class ConfigMixin: ...@@ -310,9 +310,6 @@ class ConfigMixin:
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -343,7 +340,6 @@ class ConfigMixin: ...@@ -343,7 +340,6 @@ class ConfigMixin:
local_dir = kwargs.pop("local_dir", None) local_dir = kwargs.pop("local_dir", None)
local_dir_use_symlinks = kwargs.pop("local_dir_use_symlinks", "auto") local_dir_use_symlinks = kwargs.pop("local_dir_use_symlinks", "auto")
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", None)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
local_files_only = kwargs.pop("local_files_only", False) local_files_only = kwargs.pop("local_files_only", False)
...@@ -386,7 +382,6 @@ class ConfigMixin: ...@@ -386,7 +382,6 @@ class ConfigMixin:
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
proxies=proxies, proxies=proxies,
resume_download=resume_download,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
user_agent=user_agent, user_agent=user_agent,
......
...@@ -90,9 +90,7 @@ class IPAdapterMixin: ...@@ -90,9 +90,7 @@ class IPAdapterMixin:
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -135,7 +133,6 @@ class IPAdapterMixin: ...@@ -135,7 +133,6 @@ class IPAdapterMixin:
# Load the main state dict first. # Load the main state dict first.
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", None)
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) token = kwargs.pop("token", None)
...@@ -171,7 +168,6 @@ class IPAdapterMixin: ...@@ -171,7 +168,6 @@ class IPAdapterMixin:
weights_name=weight_name, weights_name=weight_name,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -170,9 +170,7 @@ class LoraLoaderMixin: ...@@ -170,9 +170,7 @@ class LoraLoaderMixin:
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -194,7 +192,6 @@ class LoraLoaderMixin: ...@@ -194,7 +192,6 @@ class LoraLoaderMixin:
# UNet and text encoder or both. # UNet and text encoder or both.
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", None)
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) token = kwargs.pop("token", None)
...@@ -235,7 +232,6 @@ class LoraLoaderMixin: ...@@ -235,7 +232,6 @@ class LoraLoaderMixin:
weights_name=weight_name or LORA_WEIGHT_NAME_SAFE, weights_name=weight_name or LORA_WEIGHT_NAME_SAFE,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -261,7 +257,6 @@ class LoraLoaderMixin: ...@@ -261,7 +257,6 @@ class LoraLoaderMixin:
weights_name=weight_name or LORA_WEIGHT_NAME, weights_name=weight_name or LORA_WEIGHT_NAME,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -1427,9 +1422,7 @@ class SD3LoraLoaderMixin: ...@@ -1427,9 +1422,7 @@ class SD3LoraLoaderMixin:
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download (`bool`, *optional*, defaults to `False`):
Whether or not to resume downloading the model weights and configuration files. If set to `False`, any
incompletely downloaded files are deleted.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -1450,7 +1443,6 @@ class SD3LoraLoaderMixin: ...@@ -1450,7 +1443,6 @@ class SD3LoraLoaderMixin:
# UNet and text encoder or both. # UNet and text encoder or both.
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_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) token = kwargs.pop("token", None)
...@@ -1481,7 +1473,6 @@ class SD3LoraLoaderMixin: ...@@ -1481,7 +1473,6 @@ class SD3LoraLoaderMixin:
weights_name=weight_name or LORA_WEIGHT_NAME_SAFE, weights_name=weight_name or LORA_WEIGHT_NAME_SAFE,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -1503,7 +1494,6 @@ class SD3LoraLoaderMixin: ...@@ -1503,7 +1494,6 @@ class SD3LoraLoaderMixin:
weights_name=weight_name or LORA_WEIGHT_NAME, weights_name=weight_name or LORA_WEIGHT_NAME,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -242,7 +242,6 @@ def _download_diffusers_model_config_from_hub( ...@@ -242,7 +242,6 @@ def _download_diffusers_model_config_from_hub(
revision, revision,
proxies, proxies,
force_download=None, force_download=None,
resume_download=None,
local_files_only=None, local_files_only=None,
token=None, token=None,
): ):
...@@ -253,7 +252,6 @@ def _download_diffusers_model_config_from_hub( ...@@ -253,7 +252,6 @@ def _download_diffusers_model_config_from_hub(
revision=revision, revision=revision,
proxies=proxies, proxies=proxies,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
allow_patterns=allow_patterns, allow_patterns=allow_patterns,
...@@ -288,9 +286,7 @@ class FromSingleFileMixin: ...@@ -288,9 +286,7 @@ class FromSingleFileMixin:
cache_dir (`Union[str, os.PathLike]`, *optional*): cache_dir (`Union[str, os.PathLike]`, *optional*):
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used. is not used.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -352,7 +348,6 @@ class FromSingleFileMixin: ...@@ -352,7 +348,6 @@ class FromSingleFileMixin:
deprecate("original_config_file", "1.0.0", deprecation_message) deprecate("original_config_file", "1.0.0", deprecation_message)
original_config = original_config_file original_config = original_config_file
resume_download = kwargs.pop("resume_download", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
...@@ -382,7 +377,6 @@ class FromSingleFileMixin: ...@@ -382,7 +377,6 @@ class FromSingleFileMixin:
checkpoint = load_single_file_checkpoint( checkpoint = load_single_file_checkpoint(
pretrained_model_link_or_path, pretrained_model_link_or_path,
resume_download=resume_download,
force_download=force_download, force_download=force_download,
proxies=proxies, proxies=proxies,
token=token, token=token,
...@@ -412,7 +406,6 @@ class FromSingleFileMixin: ...@@ -412,7 +406,6 @@ class FromSingleFileMixin:
revision=revision, revision=revision,
proxies=proxies, proxies=proxies,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
) )
...@@ -435,7 +428,6 @@ class FromSingleFileMixin: ...@@ -435,7 +428,6 @@ class FromSingleFileMixin:
revision=revision, revision=revision,
proxies=proxies, proxies=proxies,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
local_files_only=False, local_files_only=False,
token=token, token=token,
) )
......
...@@ -137,9 +137,7 @@ class FromOriginalModelMixin: ...@@ -137,9 +137,7 @@ class FromOriginalModelMixin:
cache_dir (`Union[str, os.PathLike]`, *optional*): cache_dir (`Union[str, os.PathLike]`, *optional*):
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used. is not used.
resume_download (`bool`, *optional*, defaults to `False`):
Whether or not to resume downloading the model weights and configuration files. If set to `False`, any
incompletely downloaded files are deleted.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -188,7 +186,6 @@ class FromOriginalModelMixin: ...@@ -188,7 +186,6 @@ class FromOriginalModelMixin:
"`from_single_file` cannot accept both `config` and `original_config` arguments. Please provide only one of these arguments" "`from_single_file` cannot accept both `config` and `original_config` arguments. Please provide only one of these arguments"
) )
resume_download = kwargs.pop("resume_download", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
...@@ -203,7 +200,6 @@ class FromOriginalModelMixin: ...@@ -203,7 +200,6 @@ class FromOriginalModelMixin:
else: else:
checkpoint = load_single_file_checkpoint( checkpoint = load_single_file_checkpoint(
pretrained_model_link_or_path_or_dict, pretrained_model_link_or_path_or_dict,
resume_download=resume_download,
force_download=force_download, force_download=force_download,
proxies=proxies, proxies=proxies,
token=token, token=token,
......
...@@ -313,7 +313,6 @@ def _is_model_weights_in_cached_folder(cached_folder, name): ...@@ -313,7 +313,6 @@ def _is_model_weights_in_cached_folder(cached_folder, name):
def load_single_file_checkpoint( def load_single_file_checkpoint(
pretrained_model_link_or_path, pretrained_model_link_or_path,
resume_download=False,
force_download=False, force_download=False,
proxies=None, proxies=None,
token=None, token=None,
...@@ -331,7 +330,6 @@ def load_single_file_checkpoint( ...@@ -331,7 +330,6 @@ def load_single_file_checkpoint(
weights_name=weights_name, weights_name=weights_name,
force_download=force_download, force_download=force_download,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -38,7 +38,6 @@ TEXT_INVERSION_NAME_SAFE = "learned_embeds.safetensors" ...@@ -38,7 +38,6 @@ TEXT_INVERSION_NAME_SAFE = "learned_embeds.safetensors"
def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs): def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs):
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", None)
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) token = kwargs.pop("token", None)
...@@ -72,7 +71,6 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs) ...@@ -72,7 +71,6 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs)
weights_name=weight_name or TEXT_INVERSION_NAME_SAFE, weights_name=weight_name or TEXT_INVERSION_NAME_SAFE,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -93,7 +91,6 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs) ...@@ -93,7 +91,6 @@ def load_textual_inversion_state_dicts(pretrained_model_name_or_paths, **kwargs)
weights_name=weight_name or TEXT_INVERSION_NAME, weights_name=weight_name or TEXT_INVERSION_NAME,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -308,9 +305,7 @@ class TextualInversionLoaderMixin: ...@@ -308,9 +305,7 @@ class TextualInversionLoaderMixin:
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
......
...@@ -97,9 +97,7 @@ class UNet2DConditionLoadersMixin: ...@@ -97,9 +97,7 @@ class UNet2DConditionLoadersMixin:
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -140,7 +138,6 @@ class UNet2DConditionLoadersMixin: ...@@ -140,7 +138,6 @@ class UNet2DConditionLoadersMixin:
""" """
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", None)
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) token = kwargs.pop("token", None)
...@@ -174,7 +171,6 @@ class UNet2DConditionLoadersMixin: ...@@ -174,7 +171,6 @@ class UNet2DConditionLoadersMixin:
weights_name=weight_name or LORA_WEIGHT_NAME_SAFE, weights_name=weight_name or LORA_WEIGHT_NAME_SAFE,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -194,7 +190,6 @@ class UNet2DConditionLoadersMixin: ...@@ -194,7 +190,6 @@ class UNet2DConditionLoadersMixin:
weights_name=weight_name or LORA_WEIGHT_NAME, weights_name=weight_name or LORA_WEIGHT_NAME,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -191,7 +191,6 @@ def _fetch_index_file( ...@@ -191,7 +191,6 @@ def _fetch_index_file(
cache_dir, cache_dir,
variant, variant,
force_download, force_download,
resume_download,
proxies, proxies,
local_files_only, local_files_only,
token, token,
...@@ -216,7 +215,6 @@ def _fetch_index_file( ...@@ -216,7 +215,6 @@ def _fetch_index_file(
weights_name=index_file_in_repo, weights_name=index_file_in_repo,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -245,9 +245,7 @@ class FlaxModelMixin(PushToHubMixin): ...@@ -245,9 +245,7 @@ class FlaxModelMixin(PushToHubMixin):
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -296,7 +294,6 @@ class FlaxModelMixin(PushToHubMixin): ...@@ -296,7 +294,6 @@ class FlaxModelMixin(PushToHubMixin):
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
from_pt = kwargs.pop("from_pt", False) from_pt = kwargs.pop("from_pt", False)
resume_download = kwargs.pop("resume_download", None)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
local_files_only = kwargs.pop("local_files_only", False) local_files_only = kwargs.pop("local_files_only", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
...@@ -316,7 +313,6 @@ class FlaxModelMixin(PushToHubMixin): ...@@ -316,7 +313,6 @@ class FlaxModelMixin(PushToHubMixin):
cache_dir=cache_dir, cache_dir=cache_dir,
return_unused_kwargs=True, return_unused_kwargs=True,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -362,7 +358,6 @@ class FlaxModelMixin(PushToHubMixin): ...@@ -362,7 +358,6 @@ class FlaxModelMixin(PushToHubMixin):
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
proxies=proxies, proxies=proxies,
resume_download=resume_download,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
user_agent=user_agent, user_agent=user_agent,
......
...@@ -434,9 +434,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin): ...@@ -434,9 +434,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -518,7 +515,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin): ...@@ -518,7 +515,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
ignore_mismatched_sizes = kwargs.pop("ignore_mismatched_sizes", False) ignore_mismatched_sizes = kwargs.pop("ignore_mismatched_sizes", False)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
from_flax = kwargs.pop("from_flax", False) from_flax = kwargs.pop("from_flax", False)
resume_download = kwargs.pop("resume_download", None)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
output_loading_info = kwargs.pop("output_loading_info", False) output_loading_info = kwargs.pop("output_loading_info", False)
local_files_only = kwargs.pop("local_files_only", None) local_files_only = kwargs.pop("local_files_only", None)
...@@ -619,7 +615,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin): ...@@ -619,7 +615,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
return_unused_kwargs=True, return_unused_kwargs=True,
return_commit_hash=True, return_commit_hash=True,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -641,7 +636,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin): ...@@ -641,7 +636,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
cache_dir=cache_dir, cache_dir=cache_dir,
variant=variant, variant=variant,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -663,7 +657,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin): ...@@ -663,7 +657,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
weights_name=FLAX_WEIGHTS_NAME, weights_name=FLAX_WEIGHTS_NAME,
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -685,7 +678,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin): ...@@ -685,7 +678,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
index_file, index_file,
cache_dir=cache_dir, cache_dir=cache_dir,
proxies=proxies, proxies=proxies,
resume_download=resume_download,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
user_agent=user_agent, user_agent=user_agent,
...@@ -700,7 +692,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin): ...@@ -700,7 +692,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
weights_name=_add_variant(SAFETENSORS_WEIGHTS_NAME, variant), weights_name=_add_variant(SAFETENSORS_WEIGHTS_NAME, variant),
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -724,7 +715,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin): ...@@ -724,7 +715,6 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
weights_name=_add_variant(WEIGHTS_NAME, variant), weights_name=_add_variant(WEIGHTS_NAME, variant),
cache_dir=cache_dir, cache_dir=cache_dir,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -1177,7 +1167,6 @@ class LegacyModelMixin(ModelMixin): ...@@ -1177,7 +1167,6 @@ class LegacyModelMixin(ModelMixin):
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", None)
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) token = kwargs.pop("token", None)
...@@ -1200,7 +1189,6 @@ class LegacyModelMixin(ModelMixin): ...@@ -1200,7 +1189,6 @@ class LegacyModelMixin(ModelMixin):
return_unused_kwargs=True, return_unused_kwargs=True,
return_commit_hash=True, return_commit_hash=True,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -263,9 +263,7 @@ class AutoPipelineForText2Image(ConfigMixin): ...@@ -263,9 +263,7 @@ class AutoPipelineForText2Image(ConfigMixin):
cache_dir (`Union[str, os.PathLike]`, *optional*): cache_dir (`Union[str, os.PathLike]`, *optional*):
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used. is not used.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -340,7 +338,6 @@ class AutoPipelineForText2Image(ConfigMixin): ...@@ -340,7 +338,6 @@ class AutoPipelineForText2Image(ConfigMixin):
""" """
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", None)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
local_files_only = kwargs.pop("local_files_only", False) local_files_only = kwargs.pop("local_files_only", False)
...@@ -349,7 +346,6 @@ class AutoPipelineForText2Image(ConfigMixin): ...@@ -349,7 +346,6 @@ class AutoPipelineForText2Image(ConfigMixin):
load_config_kwargs = { load_config_kwargs = {
"cache_dir": cache_dir, "cache_dir": cache_dir,
"force_download": force_download, "force_download": force_download,
"resume_download": resume_download,
"proxies": proxies, "proxies": proxies,
"token": token, "token": token,
"local_files_only": local_files_only, "local_files_only": local_files_only,
...@@ -554,9 +550,7 @@ class AutoPipelineForImage2Image(ConfigMixin): ...@@ -554,9 +550,7 @@ class AutoPipelineForImage2Image(ConfigMixin):
cache_dir (`Union[str, os.PathLike]`, *optional*): cache_dir (`Union[str, os.PathLike]`, *optional*):
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used. is not used.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -631,7 +625,6 @@ class AutoPipelineForImage2Image(ConfigMixin): ...@@ -631,7 +625,6 @@ class AutoPipelineForImage2Image(ConfigMixin):
""" """
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", None)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
local_files_only = kwargs.pop("local_files_only", False) local_files_only = kwargs.pop("local_files_only", False)
...@@ -640,7 +633,6 @@ class AutoPipelineForImage2Image(ConfigMixin): ...@@ -640,7 +633,6 @@ class AutoPipelineForImage2Image(ConfigMixin):
load_config_kwargs = { load_config_kwargs = {
"cache_dir": cache_dir, "cache_dir": cache_dir,
"force_download": force_download, "force_download": force_download,
"resume_download": resume_download,
"proxies": proxies, "proxies": proxies,
"token": token, "token": token,
"local_files_only": local_files_only, "local_files_only": local_files_only,
...@@ -850,9 +842,7 @@ class AutoPipelineForInpainting(ConfigMixin): ...@@ -850,9 +842,7 @@ class AutoPipelineForInpainting(ConfigMixin):
cache_dir (`Union[str, os.PathLike]`, *optional*): cache_dir (`Union[str, os.PathLike]`, *optional*):
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used. is not used.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -927,7 +917,6 @@ class AutoPipelineForInpainting(ConfigMixin): ...@@ -927,7 +917,6 @@ class AutoPipelineForInpainting(ConfigMixin):
""" """
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
force_download = kwargs.pop("force_download", False) force_download = kwargs.pop("force_download", False)
resume_download = kwargs.pop("resume_download", None)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
local_files_only = kwargs.pop("local_files_only", False) local_files_only = kwargs.pop("local_files_only", False)
...@@ -936,7 +925,6 @@ class AutoPipelineForInpainting(ConfigMixin): ...@@ -936,7 +925,6 @@ class AutoPipelineForInpainting(ConfigMixin):
load_config_kwargs = { load_config_kwargs = {
"cache_dir": cache_dir, "cache_dir": cache_dir,
"force_download": force_download, "force_download": force_download,
"resume_download": resume_download,
"proxies": proxies, "proxies": proxies,
"token": token, "token": token,
"local_files_only": local_files_only, "local_files_only": local_files_only,
......
...@@ -254,9 +254,7 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -254,9 +254,7 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin):
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -316,7 +314,6 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -316,7 +314,6 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin):
``` ```
""" """
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
resume_download = kwargs.pop("resume_download", None)
proxies = kwargs.pop("proxies", None) proxies = kwargs.pop("proxies", None)
local_files_only = kwargs.pop("local_files_only", False) local_files_only = kwargs.pop("local_files_only", False)
token = kwargs.pop("token", None) token = kwargs.pop("token", None)
...@@ -332,7 +329,6 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -332,7 +329,6 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin):
config_dict = cls.load_config( config_dict = cls.load_config(
pretrained_model_name_or_path, pretrained_model_name_or_path,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -363,7 +359,6 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -363,7 +359,6 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin):
cached_folder = snapshot_download( cached_folder = snapshot_download(
pretrained_model_name_or_path, pretrained_model_name_or_path,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
......
...@@ -435,7 +435,6 @@ def _load_empty_model( ...@@ -435,7 +435,6 @@ def _load_empty_model(
return_unused_kwargs=True, return_unused_kwargs=True,
return_commit_hash=True, return_commit_hash=True,
force_download=kwargs.pop("force_download", False), force_download=kwargs.pop("force_download", False),
resume_download=kwargs.pop("resume_download", None),
proxies=kwargs.pop("proxies", None), proxies=kwargs.pop("proxies", None),
local_files_only=kwargs.pop("local_files_only", False), local_files_only=kwargs.pop("local_files_only", False),
token=kwargs.pop("token", None), token=kwargs.pop("token", None),
...@@ -454,7 +453,6 @@ def _load_empty_model( ...@@ -454,7 +453,6 @@ def _load_empty_model(
cached_folder, cached_folder,
subfolder=name, subfolder=name,
force_download=kwargs.pop("force_download", False), force_download=kwargs.pop("force_download", False),
resume_download=kwargs.pop("resume_download", None),
proxies=kwargs.pop("proxies", None), proxies=kwargs.pop("proxies", None),
local_files_only=kwargs.pop("local_files_only", False), local_files_only=kwargs.pop("local_files_only", False),
token=kwargs.pop("token", None), token=kwargs.pop("token", None),
...@@ -544,7 +542,6 @@ def _get_final_device_map(device_map, pipeline_class, passed_class_obj, init_dic ...@@ -544,7 +542,6 @@ def _get_final_device_map(device_map, pipeline_class, passed_class_obj, init_dic
torch_dtype=torch_dtype, torch_dtype=torch_dtype,
cached_folder=kwargs.get("cached_folder", None), cached_folder=kwargs.get("cached_folder", None),
force_download=kwargs.get("force_download", None), force_download=kwargs.get("force_download", None),
resume_download=kwargs.get("resume_download", None),
proxies=kwargs.get("proxies", None), proxies=kwargs.get("proxies", None),
local_files_only=kwargs.get("local_files_only", None), local_files_only=kwargs.get("local_files_only", None),
token=kwargs.get("token", None), token=kwargs.get("token", None),
......
...@@ -533,9 +533,7 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -533,9 +533,7 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
cache_dir (`Union[str, os.PathLike]`, *optional*): cache_dir (`Union[str, os.PathLike]`, *optional*):
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used. is not used.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -625,7 +623,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -625,7 +623,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
``` ```
""" """
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
resume_download = kwargs.pop("resume_download", None)
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)
...@@ -702,7 +699,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -702,7 +699,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
cached_folder = cls.download( cached_folder = cls.download(
pretrained_model_name_or_path, pretrained_model_name_or_path,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
force_download=force_download, force_download=force_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
...@@ -842,7 +838,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -842,7 +838,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
torch_dtype=torch_dtype, torch_dtype=torch_dtype,
cached_folder=cached_folder, cached_folder=cached_folder,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -910,7 +905,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -910,7 +905,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
connected_pipes = {prefix: getattr(modelcard.data, prefix, [None])[0] for prefix in CONNECTED_PIPES_KEYS} connected_pipes = {prefix: getattr(modelcard.data, prefix, [None])[0] for prefix in CONNECTED_PIPES_KEYS}
load_kwargs = { load_kwargs = {
"cache_dir": cache_dir, "cache_dir": cache_dir,
"resume_download": resume_download,
"force_download": force_download, "force_download": force_download,
"proxies": proxies, "proxies": proxies,
"local_files_only": local_files_only, "local_files_only": local_files_only,
...@@ -1216,9 +1210,7 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -1216,9 +1210,7 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
force_download (`bool`, *optional*, defaults to `False`): force_download (`bool`, *optional*, defaults to `False`):
Whether or not to force the (re-)download of the model weights and configuration files, overriding the Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist. cached versions if they exist.
resume_download:
Deprecated and ignored. All downloads are now resumed by default when possible. Will be removed in v1
of Diffusers.
proxies (`Dict[str, str]`, *optional*): proxies (`Dict[str, str]`, *optional*):
A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128', A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request. 'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
...@@ -1271,7 +1263,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -1271,7 +1263,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
""" """
cache_dir = kwargs.pop("cache_dir", None) cache_dir = kwargs.pop("cache_dir", None)
resume_download = kwargs.pop("resume_download", None)
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)
...@@ -1311,7 +1302,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -1311,7 +1302,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
revision=revision, revision=revision,
proxies=proxies, proxies=proxies,
force_download=force_download, force_download=force_download,
resume_download=resume_download,
token=token, token=token,
) )
...@@ -1500,7 +1490,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -1500,7 +1490,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
cached_folder = snapshot_download( cached_folder = snapshot_download(
pretrained_model_name, pretrained_model_name,
cache_dir=cache_dir, cache_dir=cache_dir,
resume_download=resume_download,
proxies=proxies, proxies=proxies,
local_files_only=local_files_only, local_files_only=local_files_only,
token=token, token=token,
...@@ -1523,7 +1512,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): ...@@ -1523,7 +1512,6 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
for connected_pipe_repo_id in connected_pipes: for connected_pipe_repo_id in connected_pipes:
download_kwargs = { download_kwargs = {
"cache_dir": cache_dir, "cache_dir": cache_dir,
"resume_download": resume_download,
"force_download": force_download, "force_download": force_download,
"proxies": proxies, "proxies": proxies,
"local_files_only": local_files_only, "local_files_only": local_files_only,
......
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