From dfa7598b8368d22af9d8e89030220e3ae47d48ee Mon Sep 17 00:00:00 2001 From: xiaolao Date: Sun, 7 Jul 2024 11:53:47 +0800 Subject: [PATCH] fix import error --- utils/registry.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/utils/registry.py b/utils/registry.py index 79e3be4..22f8c94 100644 --- a/utils/registry.py +++ b/utils/registry.py @@ -52,7 +52,19 @@ def build_from_config(cfg, registry, **kwargs): if isinstance(req_type, str): req_type_entry = registry.get(req_type) if req_type_entry is None: - raise KeyError(f"{req_type} not found in {registry.name} registry") + try: + print(f"For Windows users, we explicitly import registry function {req_type} !!!") + from tools.inferences.inference_unianimate_entrance import inference_unianimate_entrance + from tools.inferences.inference_unianimate_long_entrance import inference_unianimate_long_entrance + from tools.modules.diffusions.diffusion_ddim import DiffusionDDIM + from tools.modules.diffusions.diffusion_ddim import DiffusionDDIMLong + from tools.modules.autoencoder import AutoencoderKL + from tools.modules.clip_embedder import FrozenOpenCLIPTextVisualEmbedder + from tools.modules.unet.unet_unianimate import UNetSD_UniAnimate + + req_type_entry = eval(req_type) + except: + raise KeyError(f"{req_type} not found in {registry.name} registry") if kwargs is not None: cfg.update(kwargs)