Skip to content

Commit

Permalink
don't replace_additional_special_tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
helpmefindaname committed May 29, 2024
1 parent 1037fcc commit 65363e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flair/embeddings/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,9 @@ 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:
added = self.tokenizer.add_special_tokens({"additional_special_tokens": [SENTENCE_BOUNDARY_TAG]})
added = self.tokenizer.add_special_tokens(
{"additional_special_tokens": [SENTENCE_BOUNDARY_TAG]}, replace_additional_special_tokens=False
)
transformer_model.resize_token_embeddings(transformer_model.config.vocab_size + added)

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

0 comments on commit 65363e8

Please sign in to comment.