





import io
import os
import unicodedata
from typing import Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging


__lowerCamelCase       :     List[Any]   =     logging.get_logger(__name__)

__lowerCamelCase       :     Optional[int]   =     """▁"""

__lowerCamelCase       :     List[str]   =     {"""vocab_file""": """vocab.txt""", """sentencepiece_model_ckpt""": """sentencepiece.bpe.model"""}

__lowerCamelCase       :     Tuple   =     {
    """sentencepiece_model_file""": """sentencepiece.bpe.model""",
    """vocab_file""": """vocab.txt""",
}

__lowerCamelCase       :     Optional[Any]   =     {
    """vocab_file""": {
        """ernie-m-base""": """https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/vocab.txt""",
        """ernie-m-large""": """https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/vocab.txt""",
    },
    """sentencepiece_model_file""": {
        """ernie-m-base""": """https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/sentencepiece.bpe.model""",
        """ernie-m-large""": """https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/sentencepiece.bpe.model""",
    },
}

__lowerCamelCase       :     int   =     {
    """ernie-m-base""": 514,
    """ernie-m-large""": 514,
}

__lowerCamelCase       :     Union[str, Any]   =     {
    """ernie-m-base""": {"""do_lower_case""": False},
    """ernie-m-large""": {"""do_lower_case""": False},
}



class 					A__   (       __snake_case			):
      _UpperCAmelCase	:List[str]						    =   ["input_ids"]

      _UpperCAmelCase	:Any						    =   VOCAB_FILES_NAMES
      _UpperCAmelCase	:Optional[int]						    =   PRETRAINED_INIT_CONFIGURATION
      _UpperCAmelCase	:List[Any]						    =   PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      _UpperCAmelCase	:List[str]						    =   PRETRAINED_VOCAB_FILES_MAP
      _UpperCAmelCase	:Tuple						    =   RESOURCE_FILES_NAMES





      def __init__( self       ,							A_       ,							A_=None       ,							A_=False       ,							A_="utf8"       ,							A_="[UNK]"       ,							A_="[SEP]"       ,							A_="[PAD]"       ,							A_="[CLS]"       ,							A_="[MASK]"       ,							A_ = None       ,							**A_       ,							):
       '''simple docstring'''




       UpperCamelCase	:					Dict       	=   {} if sp_model_kwargs is None else sp_model_kwargs
       super().__init__(
           do_lower_case=A_       ,							unk_token=A_       ,							sep_token=A_       ,							pad_token=A_       ,							cls_token=A_       ,							mask_token=A_       ,							vocab_file=A_       ,							encoding=A_       ,							sp_model_kwargs=self.sp_model_kwargs       ,							**A_       ,							)
       UpperCamelCase	:					List[str]       	=   do_lower_case
       UpperCamelCase	:					List[Any]       	=   sentencepiece_model_ckpt
       UpperCamelCase	:					Union[str, Any]       	=   spm.SentencePieceProcessor(**self.sp_model_kwargs   )
       self.sp_model.Load(A_   )

       # to mimic paddlenlp.transformers.ernie_m.tokenizer.ErnieMTokenizer functioning
       if vocab_file is not None:
        UpperCamelCase	:					List[Any]       	=   self.load_vocab(filepath=A_   )
       else:
        UpperCamelCase	:					Optional[Any]       	=   {self.sp_model.id_to_piece(A_   ): id for id in range(self.sp_model.get_piece_size()   )}
       UpperCamelCase	:					Union[str, Any]       	=   {v: k for k, v in self.vocab.items()}





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if text is None:
        return None

       UpperCamelCase	:					Optional[Any]       	=   self.tokenize(A_   )
       UpperCamelCase	,    UpperCamelCase	:					Any       	=   "", []

       for i, ch in enumerate(A_   ):
        if ch in self.SP_CHAR_MAPPING:
         UpperCamelCase	:					int       	=   self.SP_CHAR_MAPPING.get(A_   )
        else:
         UpperCamelCase	:					int       	=   unicodedata.normalize("NFKC"       ,							A_   )
        if self.is_whitespace(A_   ):
         continue
        normalized_text += ch
        char_mapping.extend([i] * len(A_   )   )

       UpperCamelCase	,    UpperCamelCase	,    UpperCamelCase	:					str       	=   normalized_text, [], 0

       if self.do_lower_case:
        UpperCamelCase	:					List[str]       	=   text.lower()

       for token in split_tokens:
        if token[:1] == "▁":
         UpperCamelCase	:					List[Any]       	=   token[1:]
        UpperCamelCase	:					Tuple       	=   text[offset:].index(A_   ) + offset
        UpperCamelCase	:					List[Any]       	=   start + len(A_   )

        token_mapping.append((char_mapping[start], char_mapping[end - 1] + 1)   )
        UpperCamelCase	:					Dict       	=   end
       return token_mapping





      @property
      def        __UpperCamelCase( self   ):
       '''simple docstring'''




       return len(self.vocab   )





      def        __UpperCamelCase( self   ):
       '''simple docstring'''




       return dict(self.vocab       ,							**self.added_tokens_encoder   )





      def __getstate__( self   ):
       '''simple docstring'''




       UpperCamelCase	:					Tuple       	=   self.__dict__.copy()
       UpperCamelCase	:					Dict       	=   None
       return state





      def __setstate__( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Optional[Any]       	=   d

       # for backward compatibility
       if not hasattr(self       ,							"sp_model_kwargs"   ):
        UpperCamelCase	:					Optional[int]       	=   {}

       UpperCamelCase	:					Optional[Any]       	=   spm.SentencePieceProcessor(**self.sp_model_kwargs   )
       self.sp_model.Load(self.sentencepiece_model_ckpt   )





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       return "".join((self.SP_CHAR_MAPPING.get(A_       ,							A_   ) for c in text)   )





      def        __UpperCamelCase( self       ,							A_       ,							A_=False       ,							A_=64       ,							A_=0.1   ):
       '''simple docstring'''




       if self.sp_model_kwargs.get("enable_sampling"   ) is True:
        UpperCamelCase	:					Any       	=   True
       if self.sp_model_kwargs.get("alpha"   ) is not None:
        UpperCamelCase	:					Union[str, Any]       	=   self.sp_model_kwargs.get("alpha"   )
       if self.sp_model_kwargs.get("nbest_size"   ) is not None:
        UpperCamelCase	:					Dict       	=   self.sp_model_kwargs.get("nbest_size"   )

       if not enable_sampling:
        UpperCamelCase	:					Optional[int]       	=   self.sp_model.EncodeAsPieces(A_   )
       else:
        UpperCamelCase	:					List[str]       	=   self.sp_model.SampleEncodeAsPieces(A_       ,							A_       ,							A_   )
       UpperCamelCase	:					Tuple       	=   []
       for pi, piece in enumerate(A_   ):
        if piece == SPIECE_UNDERLINE:
         if not pieces[pi + 1].startswith(A_   ) and pi != 0:
          new_pieces.append(A_   )
          continue
         else:
          continue
        UpperCamelCase	:					str       	=   0
        for i, chunk in enumerate(A_   ):
         if chunk == SPIECE_UNDERLINE:
          continue
         if self.is_ch_char(A_   ) or self.is_punct(A_   ):
          if i > lst_i and piece[lst_i:i] != SPIECE_UNDERLINE:
           new_pieces.append(piece[lst_i:i]   )
          new_pieces.append(A_   )
          UpperCamelCase	:					List[str]       	=   i + 1
         elif chunk.isdigit() and i > 0 and not piece[i - 1].isdigit():
          if i > lst_i and piece[lst_i:i] != SPIECE_UNDERLINE:
           new_pieces.append(piece[lst_i:i]   )
          UpperCamelCase	:					Any       	=   i
         elif not chunk.isdigit() and i > 0 and piece[i - 1].isdigit():
          if i > lst_i and piece[lst_i:i] != SPIECE_UNDERLINE:
           new_pieces.append(piece[lst_i:i]   )
          UpperCamelCase	:					Dict       	=   i
        if len(A_   ) > lst_i:
         new_pieces.append(piece[lst_i:]   )
       return new_pieces





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					Tuple       	=   "".join(A_   ).replace(A_       ,							" "   ).strip()
       return out_string





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					List[str]       	=   self.convert_ids_to_tokens(A_   )
       UpperCamelCase	:					Optional[Any]       	=   "".join(A_   ).replace(A_       ,							" "   ).strip()
       return out_string





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       return self.vocab.get(A_       ,							self.vocab.get(self.unk_token   )   )





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       return self.reverse_vocab.get(A_       ,							self.unk_token   )





      def        __UpperCamelCase( self       ,							A_       ,							A_=None   ):
       '''simple docstring'''




       if token_ids_a is None:
        return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
       UpperCamelCase	:					int       	=   [self.cls_token_id]
       UpperCamelCase	:					Optional[int]       	=   [self.sep_token_id]
       return _cls + token_ids_a + _sep + _sep + token_ids_a + _sep





      def        __UpperCamelCase( self       ,							A_       ,							A_=None   ):
       '''simple docstring'''




       if offset_mapping_a is None:
        return [(0, 0)] + offset_mapping_a + [(0, 0)]

       return [(0, 0)] + offset_mapping_a + [(0, 0), (0, 0)] + offset_mapping_a + [(0, 0)]





      def        __UpperCamelCase( self       ,							A_       ,							A_=None       ,							A_=False   ):
       '''simple docstring'''




       if already_has_special_tokens:
        if token_ids_a is not None:
         raise ValueError(
             "You should not supply a second sequence if the provided sequence of "
             "ids is already formatted with special tokens for the model."   )
        return [1 if x in [self.sep_token_id, self.cls_token_id] else 0 for x in token_ids_a]

       if token_ids_a is not None:
        return [1] + ([0] * len(A_   )) + [1, 1] + ([0] * len(A_   )) + [1]
       return [1] + ([0] * len(A_   )) + [1]





      def        __UpperCamelCase( self       ,							A_       ,							A_ = None   ):
       '''simple docstring'''




       if token_ids_a is None:
        # [CLS] X [SEP]
        return (len(A_   ) + 2) * [0]

       # [CLS] A [SEP] [SEP] B [SEP]
       return [0] * (len(A_   ) + 1) + [1] * (len(A_   ) + 3)





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if "\u4e00" <= char <= "\u9fff":
        return True
       return False





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if ("a" <= char <= "z") or ("A" <= char <= "Z"):
        return True
       return False





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if char in ",;:.?!~，；：。？！《》【】":
        return True
       return False





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       if char == " " or char == "\t" or char == "\n" or char == "\r":
        return True
       if len(A_   ) == 1:
        UpperCamelCase	:					Optional[Any]       	=   unicodedata.category(A_   )
        if cat == "Zs":
         return True
       return False





      def        __UpperCamelCase( self       ,							A_   ):
       '''simple docstring'''




       UpperCamelCase	:					str       	=   {}
       with io.open(A_       ,							"r"       ,							encoding="utf-8"   ) as f:
        for index, line in enumerate(A_   ):
         UpperCamelCase	:					List[Any]       	=   line.rstrip("\n"   )
         UpperCamelCase	:					Any       	=   int(A_   )

       return token_to_idx





      def        __UpperCamelCase( self       ,							A_       ,							A_ = None   ):
       '''simple docstring'''




       UpperCamelCase	:					Any       	=   0
       if os.path.isdir(A_   ):
        UpperCamelCase	:					Optional[int]       	=   os.path.join(
            A_       ,							(filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]   )
       else:
        UpperCamelCase	:					List[Any]       	=   (filename_prefix + "-" if filename_prefix else "") + save_directory
       with open(A_       ,							"w"       ,							encoding="utf-8"   ) as writer:
        for token, token_index in sorted(self.vocab.items()       ,							key=lambda A_   : kv[1]   ):
         if index != token_index:
          logger.warning(
              F"""Saving vocabulary to {vocab_file}: vocabulary indices are not consecutive."""
              " Please check that the vocabulary is not corrupted!"   )
          UpperCamelCase	:					Any       	=   token_index
         writer.write(token + "\n"   )
         index += 1

       UpperCamelCase	:					Any       	=   os.path.join(A_       ,							"sentencepiece.bpe.model"   )
       with open(A_       ,							"wb"   ) as fi:
        UpperCamelCase	:					int       	=   self.sp_model.serialized_model_proto()
        fi.write(A_   )

       return (vocab_file,)



import pickle
import shutil
import tempfile
import unittest

from transformers import SPIECE_UNDERLINE, XGLMTokenizer, XGLMTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow
from transformers.utils import cached_property

from ...test_tokenization_common import TokenizerTesterMixin


lowerCAmelCase							:  Optional[Any]   	=						get_tests_dir("""fixtures/test_sentencepiece.model""")



@require_sentencepiece
@require_tokenizers
class   __lowercase				( UpperCAmelCase_		,       unittest.TestCase	):




			"""simple docstring"""







			_UpperCAmelCase   :							Optional[Any]										=     XGLMTokenizer
			_UpperCAmelCase   :							List[Any]										=     XGLMTokenizerFast
			_UpperCAmelCase   :							Optional[int]										=     True
			_UpperCAmelCase   :							Tuple										=     True



			def        _SCREAMING_SNAKE_CASE			( self  :     Tuple):
									super().setUp()

									# We have a SentencePiece fixture for testing
									SCREAMING_SNAKE_CASE_: List[Any]  		=       XGLMTokenizer(lowerCAmelCase__   ,						keep_accents=lowerCAmelCase__)
									tokenizer.save_pretrained(self.tmpdirname)



			def        _SCREAMING_SNAKE_CASE			( self  :     Optional[Any]):
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       "<pad>"
									SCREAMING_SNAKE_CASE_: int  		=       1

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



			def        _SCREAMING_SNAKE_CASE			( self  :     List[str]):
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       list(self.get_tokenizer().get_vocab().keys())

									self.assertEqual(vocab_keys[0]   ,						"<s>")
									self.assertEqual(vocab_keys[1]   ,						"<pad>")
									self.assertEqual(len(lowerCAmelCase__)   ,						1008)



			def        _SCREAMING_SNAKE_CASE			( self  :     Any):
									self.assertEqual(self.get_tokenizer().vocab_size   ,						1008)



			def        _SCREAMING_SNAKE_CASE			( self  :     Tuple):
									SCREAMING_SNAKE_CASE_: Optional[int]  		=       XGLMTokenizer(lowerCAmelCase__   ,						keep_accents=lowerCAmelCase__)

									SCREAMING_SNAKE_CASE_: Union[str, Any]  		=       tokenizer.tokenize("This is a test")
									self.assertListEqual(lowerCAmelCase__   ,						["▁This", "▁is", "▁a", "▁t", "est"])

									self.assertListEqual(
									    tokenizer.convert_tokens_to_ids(lowerCAmelCase__)   ,						[value + tokenizer.fairseq_offset for value in [285, 46, 10, 170, 382]]   ,						)

									SCREAMING_SNAKE_CASE_: List[str]  		=       tokenizer.tokenize("I was born in 92000, and this is falsé.")
									self.assertListEqual(
									    lowerCAmelCase__   ,						[
									        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_: Optional[Any]  		=       tokenizer.convert_tokens_to_ids(lowerCAmelCase__)
									self.assertListEqual(
									    lowerCAmelCase__   ,						[
									        value + tokenizer.fairseq_offset
									        for value in [8, 21, 84, 55, 24, 19, 7, 2, 602, 347, 347, 347, 3, 12, 66, 46, 72, 80, 6, 2, 4]
									    ]   ,						)

									SCREAMING_SNAKE_CASE_: List[Any]  		=       tokenizer.convert_ids_to_tokens(lowerCAmelCase__)
									self.assertListEqual(
									    lowerCAmelCase__   ,						[
									        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>",
									        ".",
									    ]   ,						)



			@cached_property
			def        _SCREAMING_SNAKE_CASE			( self  :     Any):
									return XGLMTokenizer.from_pretrained("facebook/xglm-564M")



			def        _SCREAMING_SNAKE_CASE			( self  :     str):
									with tempfile.NamedTemporaryFile() as f:
															shutil.copyfile(lowerCAmelCase__   ,						f.name)
															SCREAMING_SNAKE_CASE_: Tuple  		=       XGLMTokenizer(f.name   ,						keep_accents=lowerCAmelCase__)
															SCREAMING_SNAKE_CASE_: List[str]  		=       pickle.dumps(lowerCAmelCase__)
									pickle.loads(lowerCAmelCase__)



			def        _SCREAMING_SNAKE_CASE			( self  :     str):
									if not self.test_rust_tokenizer:
															return

									SCREAMING_SNAKE_CASE_: Dict  		=       self.get_tokenizer()
									SCREAMING_SNAKE_CASE_: List[str]  		=       self.get_rust_tokenizer()

									SCREAMING_SNAKE_CASE_: Any  		=       "I was born in 92000, and this is falsé."

									SCREAMING_SNAKE_CASE_: Union[str, Any]  		=       tokenizer.tokenize(lowerCAmelCase__)
									SCREAMING_SNAKE_CASE_: int  		=       rust_tokenizer.tokenize(lowerCAmelCase__)
									self.assertListEqual(lowerCAmelCase__   ,						lowerCAmelCase__)

									SCREAMING_SNAKE_CASE_: List[str]  		=       tokenizer.encode(lowerCAmelCase__   ,						add_special_tokens=lowerCAmelCase__)
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       rust_tokenizer.encode(lowerCAmelCase__   ,						add_special_tokens=lowerCAmelCase__)
									self.assertListEqual(lowerCAmelCase__   ,						lowerCAmelCase__)

									SCREAMING_SNAKE_CASE_: Optional[int]  		=       self.get_rust_tokenizer()
									SCREAMING_SNAKE_CASE_: str  		=       tokenizer.encode(lowerCAmelCase__)
									SCREAMING_SNAKE_CASE_: Union[str, Any]  		=       rust_tokenizer.encode(lowerCAmelCase__)
									self.assertListEqual(lowerCAmelCase__   ,						lowerCAmelCase__)



			@slow
			def        _SCREAMING_SNAKE_CASE			( self  :     Optional[int]):
									SCREAMING_SNAKE_CASE_: Dict  		=       "Hello World!"
									SCREAMING_SNAKE_CASE_: Union[str, Any]  		=       [2, 3_1227, 4447, 35]

									self.assertListEqual(lowerCAmelCase__   ,						self.big_tokenizer.encode(lowerCAmelCase__))



			@slow
			def        _SCREAMING_SNAKE_CASE			( self  :     int):
									SCREAMING_SNAKE_CASE_: Union[str, Any]  		=       (
									    "This is a very long text with a lot of weird characters, such as: . , ~ ? ( ) \" [ ] ! : - . Also we will"
									    " add words that should not exsist and be tokenized to unk, such as saoneuhaoesuth"
									)
									# fmt: off
									SCREAMING_SNAKE_CASE_: Optional[Any]  		=       [2, 1018, 67, 11, 1988, 2617, 5631, 278, 11, 3407, 48, 7_1630, 2_8085, 4, 3234, 157, 13, 6, 5, 6, 4, 3526, 768, 15, 659, 57, 298, 3983, 864, 129, 21, 6, 5, 1_3675, 377, 652, 7580, 1_0341, 155, 2817, 422, 1666, 7, 1674, 53, 113, 20_2277, 1_7892, 33, 60, 87, 4, 3234, 157, 61, 2667, 5_2376, 19, 88, 23, 735]
									# fmt: on

									self.assertListEqual(lowerCAmelCase__   ,						self.big_tokenizer.encode(lowerCAmelCase__))




			@slow
			def        _SCREAMING_SNAKE_CASE			( self  :     int):
									# fmt: off
									SCREAMING_SNAKE_CASE_: str  		=       {
									    "input_ids": [[2, 10_8825, 1163, 15, 8_8010, 473, 1_5898, 157, 1_3672, 1857, 312, 8, 23_8021, 1163, 53, 1_3672, 1857, 312, 8, 5_3283, 18_2396, 8, 1_8566, 16, 3_6733, 4101, 8, 230, 24_4017, 12_2553, 7, 15, 13_2597, 4, 293, 1_2511, 7610, 4, 3414, 13_2597, 9, 4, 3_2361, 362, 4, 734, 2_8512, 3_2569, 18, 4, 3_2361, 2_6096, 1_4982, 73, 1_8715, 2_1433, 23_5261, 15, 492, 1_2427, 16, 53, 1_8715, 2_1433, 6_5454, 15, 2_3659, 563, 16, 278, 597, 2843, 595, 7931, 18_2396, 6_4186, 22, 886, 595, 13_2981, 53, 2_5540, 3449, 4_3982, 3_9901, 5951, 878, 330, 4, 2_7694, 8_0269, 312, 53, 6517, 1_1780, 611, 2_0408, 5], [2, 6, 13_2597, 67, 4_2897, 33, 592, 8, 16_3729, 2_5540, 361, 13_6997, 10_9514, 17_3230, 7, 501, 60, 10_2913, 196, 5631, 235, 6_3243, 473, 6, 23_1757, 74, 5277, 7905, 53, 3095, 3_7317, 22, 454, 18_3874, 5], [2, 268, 3_1298, 4_6530, 6, 13_2935, 4_3831, 7, 597, 32, 24, 3688, 9865, 5]],
									    "attention_mask": [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [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=lowerCAmelCase__   ,						model_name="facebook/xglm-564M"   ,						padding=lowerCAmelCase__   ,						)






