Unverified Commit c87fb515 authored by Ethan T.'s avatar Ethan T. Committed by GitHub
Browse files

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


Signed-off-by: default avatargambletan <ethanchang32@gmail.com>
Co-authored-by: default avatarJee Jee Li <pandaleefree@gmail.com>
Co-authored-by: default avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 5353c9b0
...@@ -599,8 +599,8 @@ class LoRAModelManager: ...@@ -599,8 +599,8 @@ class LoRAModelManager:
replacement_loras[i] = None replacement_loras[i] = None
# HACK Temporary solution for the pool model. # HACK Temporary solution for the pool model.
if self.is_pooling_model and not lora_model.check_lora_name(module_name): if self.is_pooling_model and not lora_model.check_lora_name(module_name):
replaced_module_name = module_name.replace("model.", "") replaced_module_name = module_name.removeprefix("model.")
if lora_model.check_lora_name(module_name): if lora_model.check_lora_name(replaced_module_name):
module_name = replaced_module_name module_name = replaced_module_name
if module_name.endswith(".experts"): if module_name.endswith(".experts"):
if self._is_non_gated_moe and len(replacement_loras) > 0: if self._is_non_gated_moe and len(replacement_loras) > 0:
...@@ -745,7 +745,7 @@ class LoRAModelManager: ...@@ -745,7 +745,7 @@ class LoRAModelManager:
if self.is_pooling_model and not lora_model.check_lora_name(module_name): 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, # If it's a pool model, and the layer name is not found,
# remove the prefix 'model.' and search again. # 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): if lora_model.check_lora_name(module_name):
org_module_name = module_name org_module_name = module_name
logger.info_once( logger.info_once(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment