Skip to content

Commit

Permalink
LLM: fix qwen AutoTP (#10766)
Browse files Browse the repository at this point in the history
  • Loading branch information
plusbang committed Apr 16, 2024
1 parent 3e2662c commit 0a62933
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/llm/src/ipex_llm/transformers/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,8 @@ def split_qkv_proj_func(module):
if "QWenAttention" in module.__class__.__name__:
c_attn_weight = module.c_attn.weight.data
c_attn_bias = module.c_attn.bias.data
projection_size = module.projection_size
# Compatible with AutoTP case
projection_size = c_attn_weight.shape[0] // 3
hid_size = module.hidden_size
with init_empty_weights():
q_proj = torch.nn.Linear(hid_size, projection_size)
Expand Down

0 comments on commit 0a62933

Please sign in to comment.