From c87fb515edb180bd66168484e9cae86f384f6215 Mon Sep 17 00:00:00 2001 From: "Ethan T." Date: Wed, 11 Mar 2026 18:11:27 +0800 Subject: [PATCH] fix(lora): use replaced_module_name in pooling model name check (#36402) Signed-off-by: gambletan Co-authored-by: Jee Jee Li Co-authored-by: Claude Opus 4.6 --- vllm/lora/model_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vllm/lora/model_manager.py b/vllm/lora/model_manager.py index 2209704ff..a97c13022 100644 --- a/vllm/lora/model_manager.py +++ b/vllm/lora/model_manager.py @@ -599,8 +599,8 @@ class LoRAModelManager: replacement_loras[i] = None # HACK Temporary solution for the pool model. if self.is_pooling_model and not lora_model.check_lora_name(module_name): - replaced_module_name = module_name.replace("model.", "") - if lora_model.check_lora_name(module_name): + replaced_module_name = module_name.removeprefix("model.") + if lora_model.check_lora_name(replaced_module_name): module_name = replaced_module_name if module_name.endswith(".experts"): if self._is_non_gated_moe and len(replacement_loras) > 0: @@ -745,7 +745,7 @@ class LoRAModelManager: if self.is_pooling_model and not lora_model.check_lora_name(module_name): # If it's a pool model, and the layer name is not found, # remove the prefix 'model.' and search again. - module_name = module_name.replace("model.", "") + module_name = module_name.removeprefix("model.") if lora_model.check_lora_name(module_name): org_module_name = module_name logger.info_once(