adding max_lengths for single sentences and sentences pairs

This commit is contained in:
thomwolf
2019-08-23 17:31:11 +02:00
parent 90dcd8c05d
commit 47d6853439
5 changed files with 40 additions and 0 deletions

View File

@@ -67,6 +67,14 @@ class PreTrainedTokenizer(object):
"pad_token", "cls_token", "mask_token",
"additional_special_tokens"]
@property
def max_len_single_sentence(self):
return self.max_len # Default to max_len but can be smaller in specific tokenizers to take into account special tokens
@property
def max_len_sentences_pair(self):
return self.max_len # Default to max_len but can be smaller in specific tokenizers to take into account special tokens
@property
def bos_token(self):
""" Beginning of sentence token (string). Log an error if used while not having been set. """