py : add check for '.attn.masked_bias' layers to GPT2model (#5281)

This commit is contained in:
Mirror Azure 2024-02-02 14:39:09 +03:00 committed by GitHub
parent b05102fe8c
commit 2d40085c26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1138,7 +1138,7 @@ class GPT2Model(Model):
for name, data_torch in self.get_tensors(): for name, data_torch in self.get_tensors():
# we don't need these # we don't need these
if name.endswith((".attention.masked_bias", ".attention.bias", ".attention.rotary_emb.inv_freq", ".attn.bias")): if name.endswith((".attention.masked_bias", ".attention.bias", ".attention.rotary_emb.inv_freq", ".attn.bias", ".attn.masked_bias")):
continue continue
if name.endswith((".c_attn.weight", ".c_proj.weight", ".c_fc.weight", ".c_proj.weight")): if name.endswith((".c_attn.weight", ".c_proj.weight", ".c_fc.weight", ".c_proj.weight")):