fix(lora): use replaced_module_name in pooling model name check (#36402)

Signed-off-by: gambletan <ethanchang32@gmail.com>
Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ethan T.
2026-03-11 18:11:27 +08:00
committed by GitHub
parent 5353c9b016
commit c87fb515ed

View File

@@ -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(