Skip to content

Commit 086a9f9

Browse files
committed
[megatron] fix pp mla (#4904)
1 parent de32d30 commit 086a9f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

swift/megatron/model/gpt_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __init__(
7979
use_cpu_initialization=config.use_cpu_initialization,
8080
)
8181
# save memory
82-
for i in range(config.num_layers):
82+
for i in range(len(self.decoder.layers)):
8383
if hasattr(self.decoder.layers[i].self_attention, 'rotary_pos_emb'):
8484
del self.decoder.layers[i].self_attention.rotary_pos_emb
8585
self.attention_scaling = 1.

0 commit comments

Comments
 (0)