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():
# 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
if name.endswith((".c_attn.weight", ".c_proj.weight", ".c_fc.weight", ".c_proj.weight")):