rename normalization layers
This commit is contained in:
parent
7a5d932eaf
commit
da43a545ef
1 changed files with 3 additions and 0 deletions
|
@ -2197,6 +2197,9 @@ class BertModel(Model):
|
||||||
# we are only using BERT for embeddings so we don't need the pooling layer
|
# we are only using BERT for embeddings so we don't need the pooling layer
|
||||||
if name in ("embeddings.position_ids", "pooler.dense.weight", "pooler.dense.bias") or "cls." in name:
|
if name in ("embeddings.position_ids", "pooler.dense.weight", "pooler.dense.bias") or "cls." in name:
|
||||||
return [] # we don't need these
|
return [] # we don't need these
|
||||||
|
|
||||||
|
name = name.replace("gamma", "weight")
|
||||||
|
name = name.replace("beta", "bias")
|
||||||
|
|
||||||
try_suffixes = (".weight", ".bias", ".beta", ".gamma")
|
try_suffixes = (".weight", ".bias", ".beta", ".gamma")
|
||||||
return [(self.map_tensor_name(name, try_suffixes), data_torch)]
|
return [(self.map_tensor_name(name, try_suffixes), data_torch)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue