Skip to content

Commit

Permalink
[Single file] Support revision argument when loading single file co…
Browse files Browse the repository at this point in the history
…nfig (huggingface#10168)

update
  • Loading branch information
a-r-r-o-w authored Dec 10, 2024
1 parent 6131a93 commit 0e50401
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/diffusers/loaders/single_file_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
mapping_functions = SINGLE_FILE_LOADABLE_CLASSES[mapping_class_name]

checkpoint_mapping_fn = mapping_functions["checkpoint_mapping_fn"]
if original_config:
if original_config is not None:
if "config_mapping_fn" in mapping_functions:
config_mapping_fn = mapping_functions["config_mapping_fn"]
else:
Expand All @@ -243,7 +243,7 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
original_config=original_config, checkpoint=checkpoint, **config_mapping_kwargs
)
else:
if config:
if config is not None:
if isinstance(config, str):
default_pretrained_model_config_name = config
else:
Expand All @@ -270,6 +270,7 @@ def from_single_file(cls, pretrained_model_link_or_path_or_dict: Optional[str] =
subfolder=subfolder,
local_files_only=local_files_only,
token=token,
revision=revision,
)
expected_kwargs, optional_kwargs = cls._get_signature_keys(cls)

Expand Down

0 comments on commit 0e50401

Please sign in to comment.