Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
0e50401e
Unverified
Commit
0e50401e
authored
Dec 10, 2024
by
Aryan
Committed by
GitHub
Dec 10, 2024
Browse files
[Single file] Support `revision` argument when loading single file config (#10168)
update
parent
6131a93b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/diffusers/loaders/single_file_model.py
src/diffusers/loaders/single_file_model.py
+3
-2
No files found.
src/diffusers/loaders/single_file_model.py
View file @
0e50401e
...
@@ -219,7 +219,7 @@ class FromOriginalModelMixin:
...
@@ -219,7 +219,7 @@ class FromOriginalModelMixin:
mapping_functions
=
SINGLE_FILE_LOADABLE_CLASSES
[
mapping_class_name
]
mapping_functions
=
SINGLE_FILE_LOADABLE_CLASSES
[
mapping_class_name
]
checkpoint_mapping_fn
=
mapping_functions
[
"checkpoint_mapping_fn"
]
checkpoint_mapping_fn
=
mapping_functions
[
"checkpoint_mapping_fn"
]
if
original_config
:
if
original_config
is
not
None
:
if
"config_mapping_fn"
in
mapping_functions
:
if
"config_mapping_fn"
in
mapping_functions
:
config_mapping_fn
=
mapping_functions
[
"config_mapping_fn"
]
config_mapping_fn
=
mapping_functions
[
"config_mapping_fn"
]
else
:
else
:
...
@@ -243,7 +243,7 @@ class FromOriginalModelMixin:
...
@@ -243,7 +243,7 @@ class FromOriginalModelMixin:
original_config
=
original_config
,
checkpoint
=
checkpoint
,
**
config_mapping_kwargs
original_config
=
original_config
,
checkpoint
=
checkpoint
,
**
config_mapping_kwargs
)
)
else
:
else
:
if
config
:
if
config
is
not
None
:
if
isinstance
(
config
,
str
):
if
isinstance
(
config
,
str
):
default_pretrained_model_config_name
=
config
default_pretrained_model_config_name
=
config
else
:
else
:
...
@@ -270,6 +270,7 @@ class FromOriginalModelMixin:
...
@@ -270,6 +270,7 @@ class FromOriginalModelMixin:
subfolder
=
subfolder
,
subfolder
=
subfolder
,
local_files_only
=
local_files_only
,
local_files_only
=
local_files_only
,
token
=
token
,
token
=
token
,
revision
=
revision
,
)
)
expected_kwargs
,
optional_kwargs
=
cls
.
_get_signature_keys
(
cls
)
expected_kwargs
,
optional_kwargs
=
cls
.
_get_signature_keys
(
cls
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment