




import unittest

from transformers import SPIECE_UNDERLINE, XLNetTokenizer, XLNetTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin


UpperCamelCase__ :   List[Any]						=							get_tests_dir('''fixtures/test_sentencepiece.model''')







@require_sentencepiece
@require_tokenizers
class 				lowerCAmelCase_       (					lowerCamelCase_						,     unittest.TestCase							):
				__a     :       int						=     XLNetTokenizer
				__a     :       List[str]						=     XLNetTokenizerFast
				__a     :       List[Any]						=     True
				__a     :       Optional[Any]						=     True






				def 		snake_case	(			self ):
							super().setUp()

							# We have a SentencePiece fixture for testing
							SCREAMING_SNAKE_CASE_   : Tuple					  =      XLNetTokenizer(snake_case__      ,keep_accents=snake_case__ )
							tokenizer.sanitize_special_tokens()
							tokenizer.save_pretrained(self.tmpdirname )






				def 		snake_case	(			self ):
							SCREAMING_SNAKE_CASE_   : Any					  =      '<s>'
							SCREAMING_SNAKE_CASE_   : Dict					  =      1

							self.assertEqual(self.get_tokenizer()._convert_token_to_id(snake_case__ )      ,snake_case__ )
							self.assertEqual(self.get_tokenizer()._convert_id_to_token(snake_case__ )      ,snake_case__ )






				def 		snake_case	(			self ):
							SCREAMING_SNAKE_CASE_   : Dict					  =      list(self.get_tokenizer().get_vocab().keys() )

							self.assertEqual(vocab_keys[0]      ,'<unk>' )
							self.assertEqual(vocab_keys[1]      ,'<s>' )
							self.assertEqual(vocab_keys[-1]      ,'<eod>' )
							self.assertEqual(len(snake_case__ )      ,1006 )






				def 		snake_case	(			self ):
							self.assertEqual(self.get_tokenizer().vocab_size      ,1000 )






				def 		snake_case	(			self ):
							SCREAMING_SNAKE_CASE_   : Tuple					  =      XLNetTokenizer(snake_case__      ,keep_accents=snake_case__ )

							SCREAMING_SNAKE_CASE_   : List[str]					  =      tokenizer.tokenize('This is a test' )
							self.assertListEqual(snake_case__      ,['▁This', '▁is', '▁a', '▁t', 'est'] )

							self.assertListEqual(tokenizer.convert_tokens_to_ids(snake_case__ )      ,[285, 46, 10, 170, 382] )

							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      tokenizer.tokenize('I was born in 92000, and this is falsé.' )
							self.assertListEqual(
							    snake_case__      ,[
							        SPIECE_UNDERLINE + 'I',
							        SPIECE_UNDERLINE + 'was',
							        SPIECE_UNDERLINE + 'b',
							        'or',
							        'n',
							        SPIECE_UNDERLINE + 'in',
							        SPIECE_UNDERLINE + '',
							        '9',
							        '2',
							        '0',
							        '0',
							        '0',
							        ',',
							        SPIECE_UNDERLINE + 'and',
							        SPIECE_UNDERLINE + 'this',
							        SPIECE_UNDERLINE + 'is',
							        SPIECE_UNDERLINE + 'f',
							        'al',
							        's',
							        'é',
							        '.',
							    ]      ,)
							SCREAMING_SNAKE_CASE_   : Dict					  =      tokenizer.convert_tokens_to_ids(snake_case__ )
							self.assertListEqual(snake_case__      ,[8, 21, 84, 55, 24, 19, 7, 0, 602, 347, 347, 347, 3, 12, 66, 46, 72, 80, 6, 0, 4] )

							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      tokenizer.convert_ids_to_tokens(snake_case__ )
							self.assertListEqual(
							    snake_case__      ,[
							        SPIECE_UNDERLINE + 'I',
							        SPIECE_UNDERLINE + 'was',
							        SPIECE_UNDERLINE + 'b',
							        'or',
							        'n',
							        SPIECE_UNDERLINE + 'in',
							        SPIECE_UNDERLINE + '',
							        '<unk>',
							        '2',
							        '0',
							        '0',
							        '0',
							        ',',
							        SPIECE_UNDERLINE + 'and',
							        SPIECE_UNDERLINE + 'this',
							        SPIECE_UNDERLINE + 'is',
							        SPIECE_UNDERLINE + 'f',
							        'al',
							        's',
							        '<unk>',
							        '.',
							    ]      ,)






				def 		snake_case	(			self ):
							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      XLNetTokenizer(snake_case__      ,do_lower_case=snake_case__ )
							SCREAMING_SNAKE_CASE_   : List[Any]					  =      tokenizer.tokenize('I was born in 92000, and this is falsé.' )
							self.assertListEqual(
							    snake_case__      ,[
							        SPIECE_UNDERLINE + '',
							        'i',
							        SPIECE_UNDERLINE + 'was',
							        SPIECE_UNDERLINE + 'b',
							        'or',
							        'n',
							        SPIECE_UNDERLINE + 'in',
							        SPIECE_UNDERLINE + '',
							        '9',
							        '2',
							        '0',
							        '0',
							        '0',
							        ',',
							        SPIECE_UNDERLINE + 'and',
							        SPIECE_UNDERLINE + 'this',
							        SPIECE_UNDERLINE + 'is',
							        SPIECE_UNDERLINE + 'f',
							        'al',
							        'se',
							        '.',
							    ]      ,)
							self.assertListEqual(tokenizer.tokenize('H\u00E9llo' )      ,['▁he', 'll', 'o'] )






				def 		snake_case	(			self ):
							SCREAMING_SNAKE_CASE_   : List[Any]					  =      XLNetTokenizer(snake_case__      ,do_lower_case=snake_case__ )
							SCREAMING_SNAKE_CASE_   : List[Any]					  =      tokenizer.tokenize('I was born in 92000, and this is falsé.' )
							self.assertListEqual(
							    snake_case__      ,[
							        SPIECE_UNDERLINE + 'I',
							        SPIECE_UNDERLINE + 'was',
							        SPIECE_UNDERLINE + 'b',
							        'or',
							        'n',
							        SPIECE_UNDERLINE + 'in',
							        SPIECE_UNDERLINE + '',
							        '9',
							        '2',
							        '0',
							        '0',
							        '0',
							        ',',
							        SPIECE_UNDERLINE + 'and',
							        SPIECE_UNDERLINE + 'this',
							        SPIECE_UNDERLINE + 'is',
							        SPIECE_UNDERLINE + 'f',
							        'al',
							        'se',
							        '.',
							    ]      ,)






				@slow
				def 		snake_case	(			self ):
							SCREAMING_SNAKE_CASE_   : Tuple					  =      XLNetTokenizer.from_pretrained('xlnet-base-cased' )

							SCREAMING_SNAKE_CASE_   : List[str]					  =      tokenizer.encode('sequence builders'      ,add_special_tokens=snake_case__ )
							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      tokenizer.encode('multi-sequence build'      ,add_special_tokens=snake_case__ )

							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      tokenizer.build_inputs_with_special_tokens(snake_case__ )
							SCREAMING_SNAKE_CASE_   : List[str]					  =      tokenizer.build_inputs_with_special_tokens(snake_case__      ,snake_case__ )

							assert encoded_sentence == text + [4, 3]
							assert encoded_pair == text + [4] + text_a + [4, 3]






				@slow
				def 		snake_case	(			self ):
							# fmt: off
							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      {'input_ids': [[17, 21442, 270, 17, 10, 14645, 318, 34, 17, 4546, 3145, 787, 13, 7752, 22018, 23, 21, 17, 4546, 3145, 787, 13, 3352, 14431, 13, 5500, 11, 1176, 580, 13, 16819, 4797, 23, 17, 10, 17135, 658, 19, 457, 7932, 13, 184, 19, 3154, 17135, 6468, 19, 1404, 12269, 19, 4229, 5356, 16264, 46, 19, 17, 20545, 10395, 9, 9, 9, 11, 28, 6421, 9531, 20729, 17, 10, 353, 17022, 11, 21, 6421, 9531, 16949, 17, 10, 11509, 753, 11, 33, 95, 2421, 7385, 956, 14431, 2626, 25, 842, 7385, 4836, 21, 1429, 2272, 9855, 3120, 161, 24738, 19, 13203, 658, 218, 787, 21, 430, 18482, 847, 2637, 9, 4, 3], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 322, 22178, 27, 1064, 22, 956, 13, 11101, 1429, 5854, 24313, 18953, 40, 422, 24366, 68, 1758, 37, 10483, 14257, 31, 207, 263, 21, 203, 3773, 25, 71, 9735, 9, 4, 3], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]}  # noqa: E501
							# fmt: on

							self.tokenizer_integration_test_util(
							    expected_encoding=snake_case__      ,model_name='xlnet-base-cased'      ,revision='c841166438c31ec7ca9a106dee7bb312b73ae511'      ,)









'''simple docstring'''


import json
from typing import Dict, List, Optional, Tuple, Union

from tokenizers import pre_tokenizers, processors

from ...tokenization_utils_base import AddedToken, BatchEncoding, EncodedInput
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import PaddingStrategy, logging
from .tokenization_led import LEDTokenizer


lowerCAmelCase_      :  int				     =  logging.get_logger(__name__)


lowerCAmelCase_      :  Optional[Any]				     =  {'vocab_file': 'vocab.json', 'merges_file': 'merges.txt', 'tokenizer_file': 'tokenizer.json'}

lowerCAmelCase_      :  List[str]				     =  {
    'vocab_file': {
        'allenai/led-base-16384': 'https://huggingface.co/allenai/led-base-16384/resolve/main/vocab.json',
    },
    'merges_file': {
        'allenai/led-base-16384': 'https://huggingface.co/allenai/led-base-16384/resolve/main/merges.txt',
    },
    'tokenizer_file': {
        'allenai/led-base-16384': 'https://huggingface.co/allenai/led-base-16384/resolve/main/tokenizer.json',
    },
}

lowerCAmelCase_      :  Tuple				     =  {
    'allenai/led-base-16384': 1_6384,
}







class      SCREAMING_SNAKE_CASE    (						snake_case_				):
      __magic_name__  :       str   							=					VOCAB_FILES_NAMES
      __magic_name__  :       str   							=					PRETRAINED_VOCAB_FILES_MAP
      __magic_name__  :       List[Any]   							=					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      __magic_name__  :       Optional[int]   							=					LEDTokenizer
      __magic_name__  :       Optional[int]   							=					['''input_ids''', '''attention_mask''']






      def __init__( self   :  str						,						lowercase__   :  int=None						,						lowercase__   :  Any=None						,						lowercase__   :  Optional[int]=None						,						lowercase__   :  List[Any]="replace"						,						lowercase__   :  Optional[Any]="<s>"						,						lowercase__   :  Optional[Any]="</s>"						,						lowercase__   :  Dict="</s>"						,						lowercase__   :  List[str]="<s>"						,						lowercase__   :  str="<unk>"						,						lowercase__   :  str="<pad>"						,						lowercase__   :  str="<mask>"						,						lowercase__   :  Union[str, Any]=False						,						lowercase__   :  Optional[int]=True						,						**lowercase__   :  str						,						):


           '''simple docstring'''

           super().__init__(
               lowercase__						,						lowercase__						,						tokenizer_file=lowercase__						,						errors=lowercase__						,						bos_token=lowercase__						,						eos_token=lowercase__						,						sep_token=lowercase__						,						cls_token=lowercase__						,						unk_token=lowercase__						,						pad_token=lowercase__						,						mask_token=lowercase__						,						add_prefix_space=lowercase__						,						trim_offsets=lowercase__						,						**lowercase__						,						)

           a_     :							str     						=  json.loads(self.backend_tokenizer.pre_tokenizer.__getstate__()       )
           if pre_tok_state.get("""add_prefix_space"""						,						lowercase__       ) != add_prefix_space:
                a_     :							Optional[int]     						=  getattr(lowercase__						,						pre_tok_state.pop("""type"""       )       )
                a_     :							List[str]     						=  add_prefix_space
                a_     :							Union[str, Any]     						=  pre_tok_class(**lowercase__       )

           a_     :							Union[str, Any]     						=  add_prefix_space

           # the pre_tokenizer is already updated in the GPT2TokenizerFast `__init__`
           a_     :							Any     						=  """post_processor"""
           a_     :							int     						=  getattr(self.backend_tokenizer						,						lowercase__						,						lowercase__       )
           if tokenizer_component_instance:
                a_     :							Optional[int]     						=  json.loads(tokenizer_component_instance.__getstate__()       )

                # The lists 'sep' and 'cls' must be cased in tuples for the object `post_processor_class`
                if "sep" in state:
                     a_     :							int     						=  tuple(state["""sep"""]       )
                if "cls" in state:
                     a_     :							Optional[int]     						=  tuple(state["""cls"""]       )

                a_     :							List[Any]     						=  False

                if state.get("""add_prefix_space"""						,						lowercase__       ) != add_prefix_space:
                     a_     :							Optional[Any]     						=  add_prefix_space
                     a_     :							Dict     						=  True

                if state.get("""trim_offsets"""						,						lowercase__       ) != trim_offsets:
                     a_     :							List[Any]     						=  trim_offsets
                     a_     :							Optional[Any]     						=  True

                if changes_to_apply:
                     a_     :							Optional[int]     						=  getattr(lowercase__						,						state.pop("""type"""       )       )
                     a_     :							Any     						=  component_class(**lowercase__       )
                     setattr(self.backend_tokenizer						,						lowercase__						,						lowercase__       )






      @property
      # Copied from transformers.models.bart.tokenization_bart_fast.BartTokenizerFast.mask_token with BART->LED
      def 							lowercase_						( self   :  Dict       ):


           '''simple docstring'''

           if self._mask_token is None:
                if self.verbose:
                     logger.error("""Using mask_token, but it is not set yet."""       )
                return None
           return str(self._mask_token       )






      @mask_token.setter
      def 							lowercase_						( self   :  List[Any]						,						lowercase__   :  Union[str, Any]       ):


           '''simple docstring'''

           a_     :							Dict     						=  AddedToken(lowercase__						,						lstrip=lowercase__						,						rstrip=lowercase__       ) if isinstance(lowercase__						,						lowercase__       ) else value
           a_     :							Optional[int]     						=  value






      def 							lowercase_						( self   :  Optional[int]						,						*lowercase__   :  Any						,						**lowercase__   :  str       ):


           '''simple docstring'''

           a_     :							Any     						=  kwargs.get("""is_split_into_words"""						,						lowercase__       )

           if is_split_into_words and not self.add_prefix_space:
                raise ValueError(
                    F"You need to instantiate {self.__class__.__name__} with add_prefix_space=True "
                    """to use it with pretokenized inputs."""       )

           return super()._batch_encode_plus(*lowercase__						,						**lowercase__       )






      def 							lowercase_						( self   :  List[Any]						,						*lowercase__   :  str						,						**lowercase__   :  Dict       ):


           '''simple docstring'''

           a_     :							Dict     						=  kwargs.get("""is_split_into_words"""						,						lowercase__       )

           if is_split_into_words and not self.add_prefix_space:
                raise ValueError(
                    F"You need to instantiate {self.__class__.__name__} with add_prefix_space=True "
                    """to use it with pretokenized inputs."""       )

           return super()._encode_plus(*lowercase__						,						**lowercase__       )






      def 							lowercase_						( self   :  int						,						lowercase__   :  str						,						lowercase__   :  Optional[str] = None       ):


           '''simple docstring'''

           a_     :							List[str]     						=  self._tokenizer.model.save(lowercase__						,						name=lowercase__       )
           return tuple(lowercase__       )






      def 							lowercase_						( self   :  List[str]						,						lowercase__   :  List[str]						,						lowercase__   :  int=None       ):


           '''simple docstring'''

           a_     :							List[str]     						=  [self.bos_token_id] + token_ids_a + [self.eos_token_id]
           if token_ids_a is None:
                return output

           return output + [self.eos_token_id] + token_ids_a + [self.eos_token_id]






      def 							lowercase_						( self   :  List[Any]						,						lowercase__   :  List[int]						,						lowercase__   :  Optional[List[int]] = None       ):


           '''simple docstring'''

           a_     :							Optional[int]     						=  [self.sep_token_id]
           a_     :							int     						=  [self.cls_token_id]

           if token_ids_a is None:
                return len(cls + token_ids_a + sep       ) * [0]
           return len(cls + token_ids_a + sep + sep + token_ids_a + sep       ) * [0]






      def 							lowercase_						( self   :  Optional[Any]						,						lowercase__   :  Union[Dict[str, EncodedInput], BatchEncoding]						,						lowercase__   :  Optional[int] = None						,						lowercase__   :  PaddingStrategy = PaddingStrategy.DO_NOT_PAD						,						lowercase__   :  Optional[int] = None						,						lowercase__   :  Optional[bool] = None						,						):


           '''simple docstring'''

           a_     :							Union[str, Any]     						=  super()._pad(
               encoded_inputs=lowercase__						,						max_length=lowercase__						,						padding_strategy=lowercase__						,						pad_to_multiple_of=lowercase__						,						return_attention_mask=lowercase__						,						)

           # Load from model defaults
           if return_attention_mask is None:
                a_     :							Tuple     						=  """attention_mask""" in self.model_input_names

           if return_attention_mask and "global_attention_mask" in encoded_inputs:
                a_     :							Tuple     						=  encoded_inputs[self.model_input_names[0]]
                # `global_attention_mask` need to have the same length as other (sequential) inputs.
                a_     :							Optional[int]     						=  len(encoded_inputs["""global_attention_mask"""]       ) != len(lowercase__       )

                if needs_to_be_padded:
                     a_     :							int     						=  len(lowercase__       ) - len(encoded_inputs["""global_attention_mask"""]       )

                     if self.padding_side == "right":
                          # Use `-1` since `0` in `global_attention_mask` means `local attention` instead of `not to attend`
                          a_     :							Optional[int]     						=  (
                              encoded_inputs["""global_attention_mask"""] + [-1] * difference
                          )
                     elif self.padding_side == "left":
                          a_     :							Dict     						=  [-1] * difference + encoded_inputs[
                              """global_attention_mask"""
                          ]
                     else:
                          raise ValueError("""Invalid padding strategy:""" + str(self.padding_side       )       )

           return encoded_inputs
