Skip to content

Commit

Permalink
change pad token id to config pad token id
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickvonplaten committed Apr 14, 2020
1 parent 092cf88 commit e5e5aa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/modeling_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class BertEmbeddings(nn.Module):

def __init__(self, config):
super().__init__()
self.word_embeddings = nn.Embedding(config.vocab_size, config.hidden_size, padding_idx=0)
self.word_embeddings = nn.Embedding(config.vocab_size, config.hidden_size, padding_idx=config.pad_token_id)
self.position_embeddings = nn.Embedding(config.max_position_embeddings, config.hidden_size)
self.token_type_embeddings = nn.Embedding(config.type_vocab_size, config.hidden_size)

Expand Down

0 comments on commit e5e5aa8

Please sign in to comment.