@@ -131,11 +131,13 @@ class LlamaTokenizer(PreTrainedTokenizer):
...
@@ -131,11 +131,13 @@ class LlamaTokenizer(PreTrainedTokenizer):
legacy=legacy,
legacy=legacy,
**kwargs,
**kwargs,
)
)
iflegacy:
iflegacyisNone:
logger.warning_once(
logger.warning_once(
f"You are using the legacy behaviour of the {self.__class__}. This means that tokens that come after special tokens will not be properly handled. We recommend you to"
f"You are using the default legacy behaviour of the {self.__class__}. This means that tokens that come after special tokens will not be properly handled. We recommend you to"
" read the related pull request available at https://github.com/huggingface/transformers/pull/24565"
" read the related pull request available at https://github.com/huggingface/transformers/pull/24565, and set the legacy attribute accordingly."
@@ -148,7 +148,7 @@ class T5Tokenizer(PreTrainedTokenizer):
...
@@ -148,7 +148,7 @@ class T5Tokenizer(PreTrainedTokenizer):
extra_ids=100,
extra_ids=100,
additional_special_tokens=None,
additional_special_tokens=None,
sp_model_kwargs:Optional[Dict[str,Any]]=None,
sp_model_kwargs:Optional[Dict[str,Any]]=None,
legacy=True,
legacy=None,
**kwargs,
**kwargs,
)->None:
)->None:
# Add extra_ids to the special token list
# Add extra_ids to the special token list
...
@@ -163,11 +163,12 @@ class T5Tokenizer(PreTrainedTokenizer):
...
@@ -163,11 +163,12 @@ class T5Tokenizer(PreTrainedTokenizer):
" provided to T5Tokenizer. In this case the additional_special_tokens must include the extra_ids"
" provided to T5Tokenizer. In this case the additional_special_tokens must include the extra_ids"
" tokens"
" tokens"
)
)
iflegacy:
iflegacyisNone:
logger.warning_once(
logger.warning_once(
f"You are using the legacy behaviour of the {self.__class__}. This means that tokens that come after special tokens will not be properly handled. We recommend you to"
f"You are using the default legacy behaviour of the {self.__class__}. This means that tokens that come after special tokens will not be properly handled. We recommend you to"
" read the related pull request available at https://github.com/huggingface/transformers/pull/24565"
" read the related pull request available at https://github.com/huggingface/transformers/pull/24565, and set the legacy attribute accordingly."