Skip to content

Commit

Permalink
[Core] pass revision in the loading_kwargs. (huggingface#7019)
Browse files Browse the repository at this point in the history
* pass revision in the loading_kwarhs.

* remove revision from load_sub_model.
  • Loading branch information
sayakpaul authored Feb 27, 2024
1 parent 8a69273 commit 848f9fe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/diffusers/pipelines/pipeline_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ def load_sub_model(
variant: str,
low_cpu_mem_usage: bool,
cached_folder: Union[str, os.PathLike],
revision: str = None,
):
"""Helper method to load the module `name` from `library_name` and `class_name`"""
# retrieve class candidates
Expand Down Expand Up @@ -504,6 +503,7 @@ def load_sub_model(
loading_kwargs["offload_folder"] = offload_folder
loading_kwargs["offload_state_dict"] = offload_state_dict
loading_kwargs["variant"] = model_variants.pop(name, None)

if from_flax:
loading_kwargs["from_flax"] = True

Expand Down Expand Up @@ -1280,7 +1280,6 @@ def load_module(name, value):
variant=variant,
low_cpu_mem_usage=low_cpu_mem_usage,
cached_folder=cached_folder,
revision=revision,
)
logger.info(
f"Loaded {name} as {class_name} from `{name}` subfolder of {pretrained_model_name_or_path}."
Expand Down

0 comments on commit 848f9fe

Please sign in to comment.