From 147030e2af2dbf16bbd5aecde9fc9fdec49c33c3 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Wed, 8 Apr 2026 12:23:59 +0200 Subject: [PATCH] fix: surface real import error when omnivoice fails to load The broad except ImportError was swallowing the actual failure reason (e.g. a missing transitive dep after --no-deps install). Now captures and re-raises the original exception in the error message so users can diagnose what is actually missing. Co-Authored-By: Claude Sonnet 4.6 --- nodes/loader.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/nodes/loader.py b/nodes/loader.py index 43b1d7f..8a01421 100644 --- a/nodes/loader.py +++ b/nodes/loader.py @@ -1,10 +1,12 @@ import os import torch +_omnivoice_import_error = None try: from omnivoice import OmniVoice -except ImportError: - OmniVoice = None # deferred; will raise at runtime if package is missing +except Exception as e: + OmniVoice = None + _omnivoice_import_error = e try: import folder_paths @@ -55,9 +57,14 @@ class OmniVoiceModelLoader: def load_model(self, device, dtype, compile=False): if OmniVoice is None: - raise ImportError( - "omnivoice is not installed. Run: pip install omnivoice --no-deps" + msg = ( + "omnivoice failed to import. " + "Install it with: pip install omnivoice --no-deps\n" + "(On Windows embedded Python: .\\python_embeded\\python.exe -m pip install omnivoice --no-deps)\n" ) + if _omnivoice_import_error is not None: + msg += f"\nOriginal error: {_omnivoice_import_error}" + raise ImportError(msg) model = OmniVoice.from_pretrained( "k2-fsa/OmniVoice",