[Bugfix]Fix MiniCPM's LoRA bug (#9286)

This commit is contained in:
Jee Jee Li
2024-10-13 00:36:47 +08:00
committed by GitHub
parent 2b184ddd4f
commit 250e26a63e
3 changed files with 40 additions and 17 deletions

View File

@@ -216,6 +216,28 @@ class MiniCPM3Model(MiniCPMModel):
class MiniCPM3ForCausalLM(MiniCPMForCausalLM):
packed_modules_mapping = {
"gate_up_proj": [
"gate_proj",
"up_proj",
],
}
# LoRA specific attributes
supported_lora_modules = [
"kv_a_proj_with_mqa",
"q_a_proj",
"q_b_proj",
"kv_b_proj",
"o_proj",
"gate_up_proj",
"down_proj",
"embed_tokens",
"lm_head",
]
# `embedding_modules` and `embedding_padding_modules`
# are inherited from MiniCPMForCausalLM
def _init_model(self):
self.model = MiniCPM3Model(config=self.config,