[Qwen2.5] Support bnb quant for Qwen2.5 (#9467)

This commit is contained in:
Haoyu Wang 2024-10-18 12:40:14 +08:00 committed by GitHub
parent de4008e2ab
commit 154a8ae880
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -364,6 +364,14 @@ class Qwen2ForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
]
embedding_modules = {}
embedding_padding_modules = []
bitsandbytes_stacked_params_mapping = {
# shard_name, weight_name, index
"q_proj": ("qkv_proj", 0),
"k_proj": ("qkv_proj", 1),
"v_proj": ("qkv_proj", 2),
"gate_proj": ("gate_up_proj", 0),
"up_proj": ("gate_up_proj", 1),
}
def __init__(
self,