From 51655d352660d9759a95314da4206ed3c0c8d9b0 Mon Sep 17 00:00:00 2001 From: tastelikefeet <58414341+tastelikefeet@users.noreply.github.com> Date: Sat, 15 Mar 2025 13:39:24 +0800 Subject: [PATCH] add more diffusers imports (#1265) --- modelscope/utils/hf_util/patcher.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modelscope/utils/hf_util/patcher.py b/modelscope/utils/hf_util/patcher.py index 6a41a5ce..ecc33662 100644 --- a/modelscope/utils/hf_util/patcher.py +++ b/modelscope/utils/hf_util/patcher.py @@ -31,7 +31,11 @@ def get_all_imported_modules(): 'Pipeline' ] peft_include_names = ['.*PeftModel.*', '.*Config'] - diffusers_include_names = ['^(?!TF|Flax).*Pipeline$'] + diffusers_include_names = [ + '^(?!TF|Flax).*Pipeline$', '^(?!TF|Flax).*Autoencoder.*', + '^(?!TF|Flax).*Model$', '^(?!TF|Flax).*Adapter$', 'ImageProjection', + '^(?!TF|Flax).*UNet$' + ] if importlib.util.find_spec('transformers') is not None: import transformers lazy_module = sys.modules['transformers']