Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Fix XLNet token type number (#4125)
Browse files Browse the repository at this point in the history
The max type id is 2, but the number of ids is 3

Co-authored-by: Evan Pete Walsh <epwalsh10@gmail.com>
Co-authored-by: Dirk Groeneveld <dirkg@allenai.org>
  • Loading branch information
3 people committed Apr 30, 2020
1 parent ca9118f commit 0f8346d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_output_dim(self):
def _number_of_token_type_embeddings(self):
config = self.transformer_model.config
if isinstance(config, XLNetConfig):
return 2 # XLNet has hardcoded 2
return 3 # XLNet has 3 type ids
elif hasattr(config, "type_vocab_size"):
return config.type_vocab_size
else:
Expand Down

0 comments on commit 0f8346d

Please sign in to comment.