From 35b7e96e93c27b46ede886c4469268453b9c303e Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 4 May 2026 21:49:33 +0800 Subject: [PATCH] Fix bare except blocks that silently swallow all errors Replace `except Exception: pass` with `except ValueError: pass` in vLLM plugin registration. The broad Exception handler hides real errors like TypeError or AttributeError that indicate a genuine bug (e.g., wrong argument types), not just "already registered". The transformers registry raises ValueError when a config class is already registered, so catching ValueError is sufficient. Co-Authored-By: Claude Opus 4.7 --- vllm_plugin/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vllm_plugin/__init__.py b/vllm_plugin/__init__.py index 989acb4d..a1290536 100644 --- a/vllm_plugin/__init__.py +++ b/vllm_plugin/__init__.py @@ -43,14 +43,14 @@ def register_vibevoice(): slow_tokenizer_class=Qwen2Tokenizer, fast_tokenizer_class=VibeVoiceASRTextTokenizerFast, ) - except Exception: - pass # May already be registered + except ValueError: + pass # Already registered # Register the processor with transformers try: AutoProcessor.register(VibeVoiceConfig, processor_class=Qwen2AudioProcessor) - except Exception: - pass # May already be registered + except ValueError: + pass # Already registered # Register the model class with the architecture name "VibeVoice" # This name must match the "architectures" list in config.json