Skip to content

Commit

Permalink
fix embedding size for xlm roberta models
Browse files Browse the repository at this point in the history
  • Loading branch information
helpmefindaname committed Oct 27, 2023
1 parent c375fba commit 032260c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flair/embeddings/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,8 @@ def is_supported_t5_model(config: PretrainedConfig) -> bool:
# If we use a context separator, add a new special token
self.use_context_separator = use_context_separator
if use_context_separator:
self.tokenizer.add_special_tokens({"additional_special_tokens": [SENTENCE_BOUNDARY_TAG]})
transformer_model.resize_token_embeddings(len(self.tokenizer))
added = self.tokenizer.add_special_tokens({"additional_special_tokens": [SENTENCE_BOUNDARY_TAG]})
transformer_model.resize_token_embeddings(transformer_model.config.vocab_size + added)

super().__init__(**self.to_args())

Expand Down

0 comments on commit 032260c

Please sign in to comment.