support internlm2 (#797)

* support internlm2

* only attention projections

---------

Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
Chen Xin
2024-05-27 21:22:21 +08:00
committed by GitHub
parent ca7ce60c91
commit aac98ca6f4
5 changed files with 219 additions and 0 deletions

View File

@@ -119,6 +119,8 @@ def linear_to_lora_layers(
keys = set(["mixer.Wqkv", "moe.gate"])
elif model.model_type == "dbrx":
keys = set(["norm_attn_norm.attn.Wqkv", "ffn.router.layer"])
elif model.model_type == "internlm2":
keys = set(["attention.wqkv", "attention.wo"])
else:
raise ValueError(f"Lora does not support {model.model_type}")