[LoRA][2/2]Remove LoRA extra vocab (#28545)
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
This commit is contained in:
@@ -166,6 +166,16 @@ def parse_fine_tuned_lora_name(
|
||||
raise ValueError(f"{name} is unsupported LoRA weight")
|
||||
|
||||
|
||||
def is_base_embeddding_weights(name: str) -> bool:
|
||||
# hardcoded subfixes for input & output embedding weights
|
||||
input_embedding_subfix = ".embed_tokens.base_layer.weight"
|
||||
output_embedding_subfix = ".lm_head.base_layer.weight"
|
||||
|
||||
return name.endswith(input_embedding_subfix) or name.endswith(
|
||||
output_embedding_subfix
|
||||
)
|
||||
|
||||
|
||||
def is_regex_target_modules(
|
||||
load_modules: str | list[str], expected_lora_modules: list[str]
|
||||
) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user