From 7e02593cf76595de602fd28ee0408469f441ce1e Mon Sep 17 00:00:00 2001 From: Hawk Lee Date: Mon, 29 Dec 2025 14:08:30 +0800 Subject: [PATCH] fix: improved regex for patching relative imports in bundled VibeVoice modules (v1.5.00) --- aiia_vibevoice_nodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aiia_vibevoice_nodes.py b/aiia_vibevoice_nodes.py index 0787007..6e8552a 100644 --- a/aiia_vibevoice_nodes.py +++ b/aiia_vibevoice_nodes.py @@ -99,7 +99,10 @@ class AIIA_VibeVoice_Loader: source_code = f.read() # PATCH: Convert relative imports to absolute - source_code = re.sub(r'from \.(\w+)', r'from \1', source_code) + # Regex handles "from .module" with variable spacing + source_code, n_subs = re.subn(r'from\s+\.(\w+)', r'from \1', source_code) + if n_subs > 0: + print(f"[AIIA] Patched {n_subs} relative imports in {module_name}") # PATCH: Fix unsafe .to(device) on potential None types in VibeVoice generation code # (Ideally this should be fixed in the source file, but we keep this just in case users load unpatched files)