




import argparse
import json
from pathlib import Path

import requests
import torch
from huggingface_hub import hf_hub_download
from PIL import Image

from transformers import (
    MobileViTConfig,
    MobileViTForImageClassification,
    MobileViTForSemanticSegmentation,
    MobileViTImageProcessor,
)
from transformers.utils import logging


logging.set_verbosity_info()
UpperCAmelCase_		:					List[str]          =  logging.get_logger(__name__)




def 		lowerCAmelCase_ (						lowerCamelCase ):
				__magic_name__						:						Tuple										=MobileViTConfig()

				# size of the architecture
				if "mobilevit_s" in mobilevit_name:
								__magic_name__						:						Any										=[144, 192, 240]
								__magic_name__						:						Union[str, Any]										=[16, 32, 64, 96, 128, 160, 640]
				elif "mobilevit_xs" in mobilevit_name:
								__magic_name__						:						Dict										=[96, 120, 144]
								__magic_name__						:						str										=[16, 32, 48, 64, 80, 96, 384]
				elif "mobilevit_xxs" in mobilevit_name:
								__magic_name__						:						List[str]										=[64, 80, 96]
								__magic_name__						:						List[str]										=[16, 16, 24, 48, 64, 80, 320]
								__magic_name__						:						Optional[int]										=0.0_5
								__magic_name__						:						int										=2.0

				if mobilevit_name.startswith("""deeplabv3_""" ):
								__magic_name__						:						int										=512
								__magic_name__						:						Dict										=16
								__magic_name__						:						Union[str, Any]										=21
								__magic_name__						:						int										="""pascal-voc-id2label.json"""
				else:
								__magic_name__						:						Union[str, Any]										=1000
								__magic_name__						:						List[Any]										="""imagenet-1k-id2label.json"""

				__magic_name__						:						List[Any]										="""huggingface/label-files"""
				__magic_name__						:						Dict										=json.load(open(hf_hub_download(lowerCamelCase						,  lowerCamelCase						,  repo_type="""dataset""" )						,  """r""" ) )
				__magic_name__						:						Any										={int(lowerCamelCase ): v for k, v in idalabel.items()}
				__magic_name__						:						int										=idalabel
				__magic_name__						:						Any										={v: k for k, v in idalabel.items()}

				return config




def 		lowerCAmelCase_ (						lowerCamelCase						,  lowerCamelCase=False ):
				for i in range(1						,  6 ):
								if F"layer_{i}." in name:
												__magic_name__						:						Dict										=name.replace(F"layer_{i}."						,  F"encoder.layer.{i - 1}." )

				if "conv_1." in name:
								__magic_name__						:						List[Any]										=name.replace("""conv_1."""						,  """conv_stem.""" )
				if ".block." in name:
								__magic_name__						:						int										=name.replace(""".block."""						,  """.""" )

				if "exp_1x1" in name:
								__magic_name__						:						str										=name.replace("""exp_1x1"""						,  """expand_1x1""" )
				if "red_1x1" in name:
								__magic_name__						:						Dict										=name.replace("""red_1x1"""						,  """reduce_1x1""" )
				if ".local_rep.conv_3x3." in name:
								__magic_name__						:						List[str]										=name.replace(""".local_rep.conv_3x3."""						,  """.conv_kxk.""" )
				if ".local_rep.conv_1x1." in name:
								__magic_name__						:						Optional[Any]										=name.replace(""".local_rep.conv_1x1."""						,  """.conv_1x1.""" )
				if ".norm." in name:
								__magic_name__						:						Tuple										=name.replace(""".norm."""						,  """.normalization.""" )
				if ".conv." in name:
								__magic_name__						:						Any										=name.replace(""".conv."""						,  """.convolution.""" )
				if ".conv_proj." in name:
								__magic_name__						:						Optional[Any]										=name.replace(""".conv_proj."""						,  """.conv_projection.""" )

				for i in range(0						,  2 ):
								for j in range(0						,  4 ):
												if F".{i}.{j}." in name:
																__magic_name__						:						int										=name.replace(F".{i}.{j}."						,  F".{i}.layer.{j}." )

				for i in range(2						,  6 ):
								for j in range(0						,  4 ):
												if F".{i}.{j}." in name:
																__magic_name__						:						Dict										=name.replace(F".{i}.{j}."						,  F".{i}." )
																if "expand_1x1" in name:
																				__magic_name__						:						Optional[int]										=name.replace("""expand_1x1"""						,  """downsampling_layer.expand_1x1""" )
																if "conv_3x3" in name:
																				__magic_name__						:						Optional[int]										=name.replace("""conv_3x3"""						,  """downsampling_layer.conv_3x3""" )
																if "reduce_1x1" in name:
																				__magic_name__						:						Any										=name.replace("""reduce_1x1"""						,  """downsampling_layer.reduce_1x1""" )

				for i in range(2						,  5 ):
								if F".global_rep.{i}.weight" in name:
												__magic_name__						:						Dict										=name.replace(F".global_rep.{i}.weight"						,  """.layernorm.weight""" )
								if F".global_rep.{i}.bias" in name:
												__magic_name__						:						Tuple										=name.replace(F".global_rep.{i}.bias"						,  """.layernorm.bias""" )

				if ".global_rep." in name:
								__magic_name__						:						List[str]										=name.replace(""".global_rep."""						,  """.transformer.""" )
				if ".pre_norm_mha.0." in name:
								__magic_name__						:						int										=name.replace(""".pre_norm_mha.0."""						,  """.layernorm_before.""" )
				if ".pre_norm_mha.1.out_proj." in name:
								__magic_name__						:						Optional[Any]										=name.replace(""".pre_norm_mha.1.out_proj."""						,  """.attention.output.dense.""" )
				if ".pre_norm_ffn.0." in name:
								__magic_name__						:						List[str]										=name.replace(""".pre_norm_ffn.0."""						,  """.layernorm_after.""" )
				if ".pre_norm_ffn.1." in name:
								__magic_name__						:						Any										=name.replace(""".pre_norm_ffn.1."""						,  """.intermediate.dense.""" )
				if ".pre_norm_ffn.4." in name:
								__magic_name__						:						Optional[int]										=name.replace(""".pre_norm_ffn.4."""						,  """.output.dense.""" )
				if ".transformer." in name:
								__magic_name__						:						int										=name.replace(""".transformer."""						,  """.transformer.layer.""" )

				if ".aspp_layer." in name:
								__magic_name__						:						List[Any]										=name.replace(""".aspp_layer."""						,  """.""" )
				if ".aspp_pool." in name:
								__magic_name__						:						List[Any]										=name.replace(""".aspp_pool."""						,  """.""" )
				if "seg_head." in name:
								__magic_name__						:						Tuple										=name.replace("""seg_head."""						,  """segmentation_head.""" )
				if "segmentation_head.classifier.classifier." in name:
								__magic_name__						:						Dict										=name.replace("""segmentation_head.classifier.classifier."""						,  """segmentation_head.classifier.""" )

				if "classifier.fc." in name:
								__magic_name__						:						Tuple										=name.replace("""classifier.fc."""						,  """classifier.""" )
				elif (not base_model) and ("segmentation_head." not in name):
								__magic_name__						:						Any										="""mobilevit.""" + name

				return name




def 		lowerCAmelCase_ (						lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase=False ):
				if base_model:
								__magic_name__						:						Any										=""""""
				else:
								__magic_name__						:						Tuple										="""mobilevit."""

				for key in orig_state_dict.copy().keys():
								__magic_name__						:						Dict										=orig_state_dict.pop(lowerCamelCase )

								if key[:8] == "encoder.":
												__magic_name__						:						Optional[int]										=key[8:]

								if "qkv" in key:
												__magic_name__						:						Tuple										=key.split(""".""" )
												__magic_name__						:						Dict										=int(key_split[0][6:] ) - 1
												__magic_name__						:						Dict										=int(key_split[3] )
												__magic_name__						:						Optional[int]										=model.get_submodule(F"{model_prefix}encoder.layer.{layer_num}" )
												__magic_name__						:						List[Any]										=layer.transformer.layer[transformer_num].attention.attention.all_head_size
												__magic_name__						:						Tuple										=(
												    F"{model_prefix}encoder.layer.{layer_num}.transformer.layer.{transformer_num}.attention.attention."
												)
												if "weight" in key:
																__magic_name__						:						Optional[int]										=val[:dim, :]
																__magic_name__						:						Tuple										=val[dim : dim * 2, :]
																__magic_name__						:						List[str]										=val[-dim:, :]
												else:
																__magic_name__						:						Tuple										=val[:dim]
																__magic_name__						:						str										=val[dim : dim * 2]
																__magic_name__						:						int										=val[-dim:]
								else:
												__magic_name__						:						Optional[int]										=val

				return orig_state_dict




def 		lowerCAmelCase_ (						):
				__magic_name__						:						List[Any]										="""http://images.cocodataset.org/val2017/000000039769.jpg"""
				__magic_name__						:						str										=Image.open(requests.get(lowerCamelCase						,  stream=lowerCamelCase ).raw )
				return im




@torch.no_grad()
def 		lowerCAmelCase_ (						lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase=False ):
				__magic_name__						:						Optional[int]										=get_mobilevit_config(lowerCamelCase )

				# load original state_dict
				__magic_name__						:						List[Any]										=torch.load(lowerCamelCase						,  map_location="""cpu""" )

				# load 🤗 model
				if mobilevit_name.startswith("""deeplabv3_""" ):
								__magic_name__						:						Union[str, Any]										=MobileViTForSemanticSegmentation(lowerCamelCase ).eval()
				else:
								__magic_name__						:						Tuple										=MobileViTForImageClassification(lowerCamelCase ).eval()

				__magic_name__						:						Dict										=convert_state_dict(lowerCamelCase						,  lowerCamelCase )
				model.load_state_dict(lowerCamelCase )

				# Check outputs on an image, prepared by MobileViTImageProcessor
				__magic_name__						:						Any										=MobileViTImageProcessor(crop_size=config.image_size						,  size=config.image_size + 32 )
				__magic_name__						:						Optional[int]										=image_processor(images=prepare_img()						,  return_tensors="""pt""" )
				__magic_name__						:						List[Any]										=model(**lowerCamelCase )
				__magic_name__						:						Union[str, Any]										=outputs.logits

				if mobilevit_name.startswith("""deeplabv3_""" ):
								assert logits.shape == (1, 21, 32, 32)

								if mobilevit_name == "deeplabv3_mobilevit_s":
												__magic_name__						:						Any										=torch.tensor(
												    [
												        [[6.2_0_6_5, 6.1_2_9_2, 6.2_0_7_0], [6.1_0_7_9, 6.1_2_5_4, 6.1_7_4_7], [6.0_0_4_2, 6.1_0_7_1, 6.1_0_3_4]],
												        [[-6.9_2_5_3, -6.8_6_5_3, -7.0_3_9_8], [-7.3_2_1_8, -7.3_9_8_3, -7.3_6_7_0], [-7.1_9_6_1, -7.2_4_8_2, -7.1_5_6_9]],
												        [[-4.4_7_2_3, -4.4_3_4_8, -4.3_7_6_9], [-5.3_6_2_9, -5.4_6_3_2, -5.4_5_9_8], [-5.1_5_8_7, -5.3_4_0_2, -5.5_0_5_9]],
												    ] )
								elif mobilevit_name == "deeplabv3_mobilevit_xs":
												__magic_name__						:						Dict										=torch.tensor(
												    [
												        [[5.4_4_4_9, 5.5_7_3_3, 5.6_3_1_4], [5.1_8_1_5, 5.3_9_3_0, 5.5_9_6_3], [5.1_6_5_6, 5.4_3_3_3, 5.4_8_5_3]],
												        [[-9.4_4_2_3, -9.7_7_6_6, -9.6_7_1_4], [-9.1_5_8_1, -9.5_7_2_0, -9.5_5_1_9], [-9.1_0_0_6, -9.6_4_5_8, -9.5_7_0_3]],
												        [[-7.7_7_2_1, -7.3_7_1_6, -7.1_5_8_3], [-8.4_5_9_9, -8.0_6_2_4, -7.7_9_4_4], [-8.4_1_7_2, -7.8_3_6_6, -7.5_0_2_5]],
												    ] )
								elif mobilevit_name == "deeplabv3_mobilevit_xxs":
												__magic_name__						:						Dict										=torch.tensor(
												    [
												        [[6.9_8_1_1, 6.9_7_4_3, 7.3_1_2_3], [7.1_7_7_7, 7.1_9_3_1, 7.3_9_3_8], [7.5_6_3_3, 7.8_0_5_0, 7.8_9_0_1]],
												        [[-1_0.5_5_3_6, -1_0.2_3_3_2, -1_0.2_9_2_4], [-1_0.2_3_3_6, -9.8_6_2_4, -9.5_9_6_4], [-1_0.8_8_4_0, -1_0.8_1_5_8, -1_0.6_6_5_9]],
												        [[-3.4_9_3_8, -3.0_6_3_1, -2.8_6_2_0], [-3.4_2_0_5, -2.8_1_3_5, -2.6_8_7_5], [-3.4_1_7_9, -2.7_9_4_5, -2.8_7_5_0]],
												    ] )
								else:
												raise ValueError(F"Unknown mobilevit_name: {mobilevit_name}" )

								assert torch.allclose(logits[0, :3, :3, :3]						,  lowerCamelCase						,  atol=1E-4 )
				else:
								assert logits.shape == (1, 1000)

								if mobilevit_name == "mobilevit_s":
												__magic_name__						:						List[str]										=torch.tensor([-0.9_8_6_6, 0.2_3_9_2, -1.1_2_4_1] )
								elif mobilevit_name == "mobilevit_xs":
												__magic_name__						:						Dict										=torch.tensor([-2.4_7_6_1, -0.9_3_9_9, -1.9_5_8_7] )
								elif mobilevit_name == "mobilevit_xxs":
												__magic_name__						:						Optional[Any]										=torch.tensor([-1.9_3_6_4, -1.2_3_2_7, -0.4_6_5_3] )
								else:
												raise ValueError(F"Unknown mobilevit_name: {mobilevit_name}" )

								assert torch.allclose(logits[0, :3]						,  lowerCamelCase						,  atol=1E-4 )

				Path(lowerCamelCase ).mkdir(exist_ok=lowerCamelCase )
				print(F"Saving model {mobilevit_name} to {pytorch_dump_folder_path}" )
				model.save_pretrained(lowerCamelCase )
				print(F"Saving image processor to {pytorch_dump_folder_path}" )
				image_processor.save_pretrained(lowerCamelCase )

				if push_to_hub:
								__magic_name__						:						List[Any]										={
								    """mobilevit_s""": """mobilevit-small""",
								    """mobilevit_xs""": """mobilevit-x-small""",
								    """mobilevit_xxs""": """mobilevit-xx-small""",
								    """deeplabv3_mobilevit_s""": """deeplabv3-mobilevit-small""",
								    """deeplabv3_mobilevit_xs""": """deeplabv3-mobilevit-x-small""",
								    """deeplabv3_mobilevit_xxs""": """deeplabv3-mobilevit-xx-small""",
								}

								print("""Pushing to the hub...""" )
								__magic_name__						:						str										=model_mapping[mobilevit_name]
								image_processor.push_to_hub(lowerCamelCase						,  organization="""apple""" )
								model.push_to_hub(lowerCamelCase						,  organization="""apple""" )


if __name__ == "__main__":
							UpperCAmelCase_		:					Tuple          =  argparse.ArgumentParser()
							# Required parameters
							parser.add_argument(
							    "--mobilevit_name",
							    default="mobilevit_s",
							    type=str,
							    help=(
							        "Name of the MobileViT model you'd like to convert. Should be one of 'mobilevit_s', 'mobilevit_xs',"
							        " 'mobilevit_xxs', 'deeplabv3_mobilevit_s', 'deeplabv3_mobilevit_xs', 'deeplabv3_mobilevit_xxs'."
							    ),
							)
							parser.add_argument(
							    "--checkpoint_path", required=True, type=str, help="Path to the original state dict (.pt file)."
							)
							parser.add_argument(
							    "--pytorch_dump_folder_path", required=True, type=str, help="Path to the output PyTorch model directory."
							)
							parser.add_argument(
							    "--push_to_hub", action="store_true", help="Whether or not to push the converted model to the 🤗 hub."
							)

							UpperCAmelCase_		:					int          =  parser.parse_args()
							convert_movilevit_checkpoint(
							    args.mobilevit_name, args.checkpoint_path, args.pytorch_dump_folder_path, args.push_to_hub
							)









import unittest

from transformers.models.xlm_prophetnet.tokenization_xlm_prophetnet import SPIECE_UNDERLINE, XLMProphetNetTokenizer
from transformers.testing_utils import get_tests_dir, require_sentencepiece, slow
from transformers.utils import cached_property

from ...test_tokenization_common import TokenizerTesterMixin


a__   :					List[Any] 						=      get_tests_dir("fixtures/test_sentencepiece.model")



@require_sentencepiece
class    UpperCAmelCase__(				lowerCamelCase  ,				unittest.TestCase						):

   '''simple docstring'''




   A     :	Tuple												=     XLMProphetNetTokenizer
   A     :	List[str]												=     False
   A     :	Union[str, Any]												=     True


   def       UpperCAmelCase		(    self	:      Any)						->					int:




         """simple docstring"""

         super().setUp()

         # We have a SentencePiece fixture for testing
         lowercase__  =	XLMProphetNetTokenizer(lowerCAmelCase      ,					keep_accents=lowerCAmelCase)
         tokenizer.save_pretrained(self.tmpdirname)


   def       UpperCAmelCase		(    self	:      Optional[int])						->					Optional[Any]:




         """simple docstring"""

         lowercase__  =	'[PAD]'
         lowercase__  =	0

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


   def       UpperCAmelCase		(    self	:      Dict)						->					List[Any]:




         """simple docstring"""

         lowercase__  =	list(self.get_tokenizer().get_vocab().keys())

         self.assertEqual(vocab_keys[0]      ,					'[PAD]')
         self.assertEqual(vocab_keys[1]      ,					'[CLS]')
         self.assertEqual(vocab_keys[-1]      ,					'j')
         self.assertEqual(len(lowerCAmelCase)      ,					10_12)


   def       UpperCAmelCase		(    self	:      Union[str, Any])						->					str:




         """simple docstring"""

         self.assertEqual(self.get_tokenizer().vocab_size      ,					10_12)


   def       UpperCAmelCase		(    self	:      Tuple)						->					Optional[int]:




         """simple docstring"""

         lowercase__  =	XLMProphetNetTokenizer(lowerCAmelCase      ,					keep_accents=lowerCAmelCase)

         lowercase__  =	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 [2_85, 46, 10, 1_70, 3_82]]      ,					)

         lowercase__  =	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',
                 'é',
                 '.',
             ]      ,					)
         lowercase__  =	tokenizer.convert_tokens_to_ids(lowerCAmelCase)
         self.assertListEqual(
             lowerCAmelCase      ,					[
                 value + tokenizer.fairseq_offset
                 for value in [8, 21, 84, 55, 24, 19, 7, -9, 6_02, 3_47, 3_47, 3_47, 3, 12, 66, 46, 72, 80, 6, -9, 4]
             ]      ,					)

         lowercase__  =	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       UpperCAmelCase		(    self	:      str)						->					List[Any]:




         """simple docstring"""

         return XLMProphetNetTokenizer.from_pretrained('microsoft/xprophetnet-large-wiki100-cased')


   @slow
   def       UpperCAmelCase		(    self	:      List[Any])						->					List[str]:




         """simple docstring"""

         lowercase__  =	'Hello World!'
         lowercase__  =	[3_53_89, 66_72, 49, 2]
         self.assertListEqual(lowerCAmelCase      ,					self.big_tokenizer.encode(lowerCAmelCase))



   @slow
   def       UpperCAmelCase		(    self	:      Tuple)						->					str:




         """simple docstring"""

         lowercase__  =	{'input_ids': [[1_10_73, 8_27_83, 18, 26, 8_27_83, 5_49, 5_15_40, 2_48, 1_72_09, 13_01, 2_17, 20, 21_51_86, 13_25, 1_47, 1_72_09, 13_01, 2_17, 20, 5_63_70, 53, 12_20_20, 20, 1_64_77, 27, 8_73_55, 45_48, 20, 47_28, 7_83_92, 17, 15_99_69, 18, 26, 2_44_91, 6_29, 15, 5_38, 2_27_04, 54_39, 15, 27_88, 2_44_91, 98_85, 15, 4_35_34, 6_05, 15, 8_14, 1_84_03, 3_32_00, 29, 15, 4_35_34, 2_44_58, 1_24_10, 1_11, 2_49_66, 8_36_69, 96_37, 14_40_68, 26, 8_50, 2_23_46, 27, 1_47, 2_49_66, 8_36_69, 8_34_90, 26, 3_91_13, 7_35, 27, 6_89, 6_56, 28_00, 13_39, 46_00, 53, 12_20_20, 11_57_85, 34, 8_16, 13_39, 4_68_87, 18, 1_47, 5_39_05, 19_51, 4_22_38, 4_11_70, 1_77_32, 8_34, 4_36, 15, 2_75_23, 9_87_33, 2_17, 1_47, 55_42, 49_81, 9_30, 1_73_47, 16, 2], [2_00_91, 6_29, 94, 8_27_86, 58, 4_90, 20, 15_28, 84, 5_39_05, 3_44, 8_05_92, 11_01_28, 1_88_22, 52_67, 13_06, 62, 15_25_37, 3_08, 79_97, 4_01, 12_44_27, 5_49, 3_54_42, 2_25, 1_09, 1_50_55, 2_57_48, 1_47, 71_19, 4_37_12, 34, 7_67, 13_53_66, 18, 16, 2, 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, 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], [5_92, 6_37_84, 11_94_66, 17, 14_78_08, 8_82_14, 18, 6_56, 81, 32, 32_96, 1_02_80, 16, 2, 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, 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, 0, 0, 0, 0, 0]], '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, 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, 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, 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, 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, 0, 0, 0, 0, 0]]}  # noqa: E501
         # fmt: on

         self.tokenizer_integration_test_util(
             expected_encoding=lowerCAmelCase      ,					model_name='microsoft/xprophetnet-large-wiki100-cased'      ,					revision='1acad1643ddd54a44df6a1b797ada8373685d90e'      ,					)
