From ddac02a2aac58a49ab0676fbb9201ec452e66dfb Mon Sep 17 00:00:00 2001 From: Mr-Neutr0n <64578610+Mr-Neutr0n@users.noreply.github.com> Date: Thu, 12 Feb 2026 00:02:06 +0530 Subject: [PATCH] Fix raise NotImplemented to raise NotImplementedError in wrap_llm_lora `NotImplemented` is a built-in constant intended for use in rich comparison methods, not an exception. Raising it directly produces a confusing `TypeError: exceptions must derive from BaseException` instead of the expected `NotImplementedError`. This change fixes the error in `wrap_llm_lora()` to properly raise `NotImplementedError` with a descriptive message showing which architecture was unsupported. --- .../internvl/model/internvl_chat/modeling_internvl_chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internvl_chat/internvl/model/internvl_chat/modeling_internvl_chat.py b/internvl_chat/internvl/model/internvl_chat/modeling_internvl_chat.py index 53f97396..997494d6 100644 --- a/internvl_chat/internvl/model/internvl_chat/modeling_internvl_chat.py +++ b/internvl_chat/internvl/model/internvl_chat/modeling_internvl_chat.py @@ -128,7 +128,7 @@ def wrap_llm_lora(self, r=128, lora_alpha=256, lora_dropout=0.05): target_modules = ['self_attn.q_proj', 'self_attn.k_proj', 'self_attn.v_proj', 'self_attn.o_proj', 'mlp.gate_proj', 'mlp.down_proj', 'mlp.up_proj'] else: - raise NotImplemented + raise NotImplementedError(f'Unsupported architecture: {self.llm_arch_name}') lora_config = LoraConfig( r=r, target_modules=target_modules,