Skip to content

Commit 848f9fe

Browse files
authored
[Core] pass revision in the loading_kwargs. (huggingface#7019)
* pass revision in the loading_kwarhs. * remove revision from load_sub_model.
1 parent 8a69273 commit 848f9fe

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ def load_sub_model(
436436
variant: str,
437437
low_cpu_mem_usage: bool,
438438
cached_folder: Union[str, os.PathLike],
439-
revision: str = None,
440439
):
441440
"""Helper method to load the module `name` from `library_name` and `class_name`"""
442441
# retrieve class candidates
@@ -504,6 +503,7 @@ def load_sub_model(
504503
loading_kwargs["offload_folder"] = offload_folder
505504
loading_kwargs["offload_state_dict"] = offload_state_dict
506505
loading_kwargs["variant"] = model_variants.pop(name, None)
506+
507507
if from_flax:
508508
loading_kwargs["from_flax"] = True
509509

@@ -1280,7 +1280,6 @@ def load_module(name, value):
12801280
variant=variant,
12811281
low_cpu_mem_usage=low_cpu_mem_usage,
12821282
cached_folder=cached_folder,
1283-
revision=revision,
12841283
)
12851284
logger.info(
12861285
f"Loaded {name} as {class_name} from `{name}` subfolder of {pretrained_model_name_or_path}."

0 commit comments

Comments
 (0)