mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
[Core] fix: legacy model mapping (#8416)
* fix: legacy model mapping * remove print
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user