Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
diffusers
Commits
a3faf3f2
Unverified
Commit
a3faf3f2
authored
Jun 06, 2024
by
Sayak Paul
Committed by
GitHub
Jun 06, 2024
Browse files
[Core] fix: legacy model mapping (#8416)
* fix: legacy model mapping * remove print
parent
867a2b0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/diffusers/models/modeling_utils.py
src/diffusers/models/modeling_utils.py
+4
-1
No files found.
src/diffusers/models/modeling_utils.py
View file @
a3faf3f2
...
...
@@ -1057,6 +1057,9 @@ class LegacyModelMixin(ModelMixin):
# To prevent depedency import problem.
from
.model_loading_utils
import
_fetch_remapped_cls_from_config
# Create a copy of the kwargs so that we don't mess with the keyword arguments in the downstream calls.
kwargs_copy
=
kwargs
.
copy
()
cache_dir
=
kwargs
.
pop
(
"cache_dir"
,
None
)
force_download
=
kwargs
.
pop
(
"force_download"
,
False
)
resume_download
=
kwargs
.
pop
(
"resume_download"
,
None
)
...
...
@@ -1094,4 +1097,4 @@ class LegacyModelMixin(ModelMixin):
# resolve remapping
remapped_class
=
_fetch_remapped_cls_from_config
(
config
,
cls
)
return
remapped_class
.
from_pretrained
(
pretrained_model_name_or_path
,
**
kwargs
)
return
remapped_class
.
from_pretrained
(
pretrained_model_name_or_path
,
**
kwargs
_copy
)
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