Skip to content

Commit 8887ed5

Browse files
authored
fix llama export (#8561)
1 parent 0e0c9b4 commit 8887ed5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddlenlp/experimental/transformers/llama/modeling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def set_state_dict(self, state_dict):
495495
num_key_value_heads=self.num_attention_heads // self.config.tensor_parallel_degree,
496496
),
497497
axis=-1,
498-
)
498+
).transpose(1, 0)
499499
else:
500500
unfused_state_dict = {}
501501
unfused_state_dict["self_attn.q_proj.weight"] = state_dict[
@@ -523,7 +523,7 @@ def set_state_dict(self, state_dict):
523523
)
524524
) # reshape(3, self.num_attention_heself.hidden_sizeads // self.config.tensor_parallel_degree, head_size, )
525525
if "llama.layers.{}.mlp.gate_up_fused_proj.weight".format(idx) in state_dict.keys():
526-
ffn1_weight_tensor = np.concatenate(
526+
concated_ffn1_weight = np.concatenate(
527527
split_fn(state_dict["llama.layers.{}.mlp.gate_up_fused_proj.weight".format(idx)]), axis=-1
528528
)
529529
else:

0 commit comments

Comments
 (0)