import argparse
import os

import torch

from diffusers import (
    CMStochasticIterativeScheduler,
    ConsistencyModelPipeline,
    UNetaDModel,
)


_lowerCAmelCase       =		{
    "sample_size": 32,
    "in_channels": 3,
    "out_channels": 3,
    "layers_per_block": 2,
    "num_class_embeds": 1_000,
    "block_out_channels": [32, 64],
    "attention_head_dim": 8,
    "down_block_types": [
        "ResnetDownsampleBlock2D",
        "AttnDownBlock2D",
    ],
    "up_block_types": [
        "AttnUpBlock2D",
        "ResnetUpsampleBlock2D",
    ],
    "resnet_time_scale_shift": "scale_shift",
    "upsample_type": "resnet",
    "downsample_type": "resnet",
}

_lowerCAmelCase       =		{
    "sample_size": 64,
    "in_channels": 3,
    "out_channels": 3,
    "layers_per_block": 3,
    "num_class_embeds": 1_000,
    "block_out_channels": [192, 192 * 2, 192 * 3, 192 * 4],
    "attention_head_dim": 64,
    "down_block_types": [
        "ResnetDownsampleBlock2D",
        "AttnDownBlock2D",
        "AttnDownBlock2D",
        "AttnDownBlock2D",
    ],
    "up_block_types": [
        "AttnUpBlock2D",
        "AttnUpBlock2D",
        "AttnUpBlock2D",
        "ResnetUpsampleBlock2D",
    ],
    "resnet_time_scale_shift": "scale_shift",
    "upsample_type": "resnet",
    "downsample_type": "resnet",
}

_lowerCAmelCase       =		{
    "sample_size": 256,
    "in_channels": 3,
    "out_channels": 3,
    "layers_per_block": 2,
    "num_class_embeds": None,
    "block_out_channels": [256, 256, 256 * 2, 256 * 2, 256 * 4, 256 * 4],
    "attention_head_dim": 64,
    "down_block_types": [
        "ResnetDownsampleBlock2D",
        "ResnetDownsampleBlock2D",
        "ResnetDownsampleBlock2D",
        "AttnDownBlock2D",
        "AttnDownBlock2D",
        "AttnDownBlock2D",
    ],
    "up_block_types": [
        "AttnUpBlock2D",
        "AttnUpBlock2D",
        "AttnUpBlock2D",
        "ResnetUpsampleBlock2D",
        "ResnetUpsampleBlock2D",
        "ResnetUpsampleBlock2D",
    ],
    "resnet_time_scale_shift": "default",
    "upsample_type": "resnet",
    "downsample_type": "resnet",
}

_lowerCAmelCase       =		{
    "num_train_timesteps": 40,
    "sigma_min": 0.002,
    "sigma_max": 80.0,
}

_lowerCAmelCase       =		{
    "num_train_timesteps": 201,
    "sigma_min": 0.002,
    "sigma_max": 80.0,
}

_lowerCAmelCase       =		{
    "num_train_timesteps": 151,
    "sigma_min": 0.002,
    "sigma_max": 80.0,
}
def 					_snake_case	(  __snake_case						):
					if isinstance(__snake_case  ,     __snake_case						):
										return v
					if v.lower() in ("yes", "true", "t", "y", "1"):
										return True
					elif v.lower() in ("no", "false", "f", "n", "0"):
										return False
					else:
										raise argparse.ArgumentTypeError('''boolean value expected'''						)
def 					_snake_case	(  __snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case=False						):
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.in_layers.0.weight"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.in_layers.0.bias"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.in_layers.2.weight"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.in_layers.2.bias"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.emb_layers.1.weight"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.emb_layers.1.bias"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.out_layers.0.weight"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.out_layers.0.bias"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.out_layers.3.weight"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.out_layers.3.bias"""]

					if has_skip:
										_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.skip_connection.weight"""]
										_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.skip_connection.bias"""]

					return new_checkpoint
def 					_snake_case	(  __snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case=None						):
					_UpperCamelCase     ,    _UpperCamelCase     ,    _UpperCamelCase			     =     checkpoint[f"""{old_prefix}.qkv.weight"""].chunk(3  ,     dim=0						)
					_UpperCamelCase     ,    _UpperCamelCase     ,    _UpperCamelCase			     =     checkpoint[f"""{old_prefix}.qkv.bias"""].chunk(3  ,     dim=0						)

					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.norm.weight"""]
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.norm.bias"""]

					_UpperCamelCase			     =     weight_q.squeeze(-1						).squeeze(-1						)
					_UpperCamelCase			     =     bias_q.squeeze(-1						).squeeze(-1						)
					_UpperCamelCase			     =     weight_k.squeeze(-1						).squeeze(-1						)
					_UpperCamelCase			     =     bias_k.squeeze(-1						).squeeze(-1						)
					_UpperCamelCase			     =     weight_v.squeeze(-1						).squeeze(-1						)
					_UpperCamelCase			     =     bias_v.squeeze(-1						).squeeze(-1						)

					_UpperCamelCase			     =     (
					    checkpoint[f"""{old_prefix}.proj_out.weight"""].squeeze(-1						).squeeze(-1						)
					)
					_UpperCamelCase			     =     checkpoint[f"""{old_prefix}.proj_out.bias"""].squeeze(-1						).squeeze(-1						)

					return new_checkpoint
def 					_snake_case	(  __snake_case  ,     __snake_case						):
					_UpperCamelCase			     =     torch.load(__snake_case  ,     map_location='''cpu'''						)
					_UpperCamelCase			     =     {}

					_UpperCamelCase			     =     checkpoint['''time_embed.0.weight''']
					_UpperCamelCase			     =     checkpoint['''time_embed.0.bias''']
					_UpperCamelCase			     =     checkpoint['''time_embed.2.weight''']
					_UpperCamelCase			     =     checkpoint['''time_embed.2.bias''']

					if unet_config["num_class_embeds"] is not None:
										_UpperCamelCase			     =     checkpoint['''label_emb.weight''']

					_UpperCamelCase			     =     checkpoint['''input_blocks.0.0.weight''']
					_UpperCamelCase			     =     checkpoint['''input_blocks.0.0.bias''']

					_UpperCamelCase			     =     unet_config['''down_block_types''']
					_UpperCamelCase			     =     unet_config['''layers_per_block''']
					_UpperCamelCase			     =     unet_config['''attention_head_dim''']
					_UpperCamelCase			     =     unet_config['''block_out_channels''']
					_UpperCamelCase			     =     1
					_UpperCamelCase			     =     channels_list[0]

					for i, layer_type in enumerate(__snake_case						):
										_UpperCamelCase			     =     channels_list[i]
										_UpperCamelCase			     =     current_channels != prev_channels
										if layer_type == "ResnetDownsampleBlock2D":
															for j in range(__snake_case						):
																				_UpperCamelCase			     =     f"""down_blocks.{i}.resnets.{j}"""
																				_UpperCamelCase			     =     f"""input_blocks.{current_layer}.0"""
																				_UpperCamelCase			     =     True if j == 0 and downsample_block_has_skip else False
																				_UpperCamelCase			     =     convert_resnet(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case  ,     has_skip=__snake_case						)
																				current_layer += 1

										elif layer_type == "AttnDownBlock2D":
															for j in range(__snake_case						):
																				_UpperCamelCase			     =     f"""down_blocks.{i}.resnets.{j}"""
																				_UpperCamelCase			     =     f"""input_blocks.{current_layer}.0"""
																				_UpperCamelCase			     =     True if j == 0 and downsample_block_has_skip else False
																				_UpperCamelCase			     =     convert_resnet(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case  ,     has_skip=__snake_case						)
																				_UpperCamelCase			     =     f"""down_blocks.{i}.attentions.{j}"""
																				_UpperCamelCase			     =     f"""input_blocks.{current_layer}.1"""
																				_UpperCamelCase			     =     convert_attention(
																				    __snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case						)
																				current_layer += 1

										if i != len(__snake_case						) - 1:
															_UpperCamelCase			     =     f"""down_blocks.{i}.downsamplers.0"""
															_UpperCamelCase			     =     f"""input_blocks.{current_layer}.0"""
															_UpperCamelCase			     =     convert_resnet(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case						)
															current_layer += 1

										_UpperCamelCase			     =     current_channels

					# hardcoded the mid-block for now
					_UpperCamelCase			     =     '''mid_block.resnets.0'''
					_UpperCamelCase			     =     '''middle_block.0'''
					_UpperCamelCase			     =     convert_resnet(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case						)
					_UpperCamelCase			     =     '''mid_block.attentions.0'''
					_UpperCamelCase			     =     '''middle_block.1'''
					_UpperCamelCase			     =     convert_attention(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case						)
					_UpperCamelCase			     =     '''mid_block.resnets.1'''
					_UpperCamelCase			     =     '''middle_block.2'''
					_UpperCamelCase			     =     convert_resnet(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case						)

					_UpperCamelCase			     =     0
					_UpperCamelCase			     =     unet_config['''up_block_types''']

					for i, layer_type in enumerate(__snake_case						):
										if layer_type == "ResnetUpsampleBlock2D":
															for j in range(layers_per_block + 1						):
																				_UpperCamelCase			     =     f"""up_blocks.{i}.resnets.{j}"""
																				_UpperCamelCase			     =     f"""output_blocks.{current_layer}.0"""
																				_UpperCamelCase			     =     convert_resnet(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case  ,     has_skip=__snake_case						)
																				current_layer += 1

															if i != len(__snake_case						) - 1:
																				_UpperCamelCase			     =     f"""up_blocks.{i}.upsamplers.0"""
																				_UpperCamelCase			     =     f"""output_blocks.{current_layer-1}.1"""
																				_UpperCamelCase			     =     convert_resnet(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case						)
										elif layer_type == "AttnUpBlock2D":
															for j in range(layers_per_block + 1						):
																				_UpperCamelCase			     =     f"""up_blocks.{i}.resnets.{j}"""
																				_UpperCamelCase			     =     f"""output_blocks.{current_layer}.0"""
																				_UpperCamelCase			     =     convert_resnet(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case  ,     has_skip=__snake_case						)
																				_UpperCamelCase			     =     f"""up_blocks.{i}.attentions.{j}"""
																				_UpperCamelCase			     =     f"""output_blocks.{current_layer}.1"""
																				_UpperCamelCase			     =     convert_attention(
																				    __snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case						)
																				current_layer += 1

															if i != len(__snake_case						) - 1:
																				_UpperCamelCase			     =     f"""up_blocks.{i}.upsamplers.0"""
																				_UpperCamelCase			     =     f"""output_blocks.{current_layer-1}.2"""
																				_UpperCamelCase			     =     convert_resnet(__snake_case  ,     __snake_case  ,     __snake_case  ,     __snake_case						)

					_UpperCamelCase			     =     checkpoint['''out.0.weight''']
					_UpperCamelCase			     =     checkpoint['''out.0.bias''']
					_UpperCamelCase			     =     checkpoint['''out.2.weight''']
					_UpperCamelCase			     =     checkpoint['''out.2.bias''']

					return new_checkpoint


if __name__ == "__main__":
					_lowerCAmelCase       =		argparse.ArgumentParser()

					parser.add_argument("--unet_path", default=None, type=str, required=True, help="Path to the unet.pt to convert.")
					parser.add_argument(
					    "--dump_path", default=None, type=str, required=True, help="Path to output the converted UNet model."
					)
					parser.add_argument("--class_cond", default=True, type=str, help="Whether the model is class-conditional.")

					_lowerCAmelCase       =		parser.parse_args()
					_lowerCAmelCase       =		strabool(args.class_cond)

					_lowerCAmelCase       =		os.path.basename(args.unet_path)
					print(f'Checkpoint: {ckpt_name}')

					# Get U-Net config
					if "imagenet64" in ckpt_name:
										_lowerCAmelCase       =		IMAGENET_64_UNET_CONFIG
					elif "256" in ckpt_name and (("bedroom" in ckpt_name) or ("cat" in ckpt_name)):
										_lowerCAmelCase       =		LSUN_256_UNET_CONFIG
					elif "test" in ckpt_name:
										_lowerCAmelCase       =		TEST_UNET_CONFIG
					else:
										raise ValueError(f'Checkpoint type {ckpt_name} is not currently supported.')

					if not args.class_cond:
										_lowerCAmelCase       =		None

					_lowerCAmelCase       =		con_pt_to_diffuser(args.unet_path, unet_config)

					_lowerCAmelCase       =		UNetaDModel(**unet_config)
					image_unet.load_state_dict(converted_unet_ckpt)

					# Get scheduler config
					if "cd" in ckpt_name or "test" in ckpt_name:
										_lowerCAmelCase       =		CD_SCHEDULER_CONFIG
					elif "ct" in ckpt_name and "imagenet64" in ckpt_name:
										_lowerCAmelCase       =		CT_IMAGENET_64_SCHEDULER_CONFIG
					elif "ct" in ckpt_name and "256" in ckpt_name and (("bedroom" in ckpt_name) or ("cat" in ckpt_name)):
										_lowerCAmelCase       =		CT_LSUN_256_SCHEDULER_CONFIG
					else:
										raise ValueError(f'Checkpoint type {ckpt_name} is not currently supported.')

					_lowerCAmelCase       =		CMStochasticIterativeScheduler(**scheduler_config)

					_lowerCAmelCase       =		ConsistencyModelPipeline(unet=image_unet, scheduler=cm_scheduler)
					consistency_model.save_pretrained(args.dump_path)

import unittest

from transformers import BertGenerationTokenizer
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_torch, slow
from transformers.utils import cached_property

from ...test_tokenization_common import TokenizerTesterMixin


_lowerCAmelCase       =		"▁"

_lowerCAmelCase       =		get_tests_dir("fixtures/test_sentencepiece.model")
@require_sentencepiece
class     lowerCAmelCase_     (       __lowercase,  unittest.TestCase ):
							UpperCAmelCase				   =     BertGenerationTokenizer
							UpperCAmelCase				   =     False
							UpperCAmelCase				   =     True







							def  UpperCamelCase_						(   self      :     List[str]		):
												super().setUp()

												_UpperCamelCase			     =     BertGenerationTokenizer(_A ,			keep_accents=_A		)
												tokenizer.save_pretrained(self.tmpdirname		)







							def  UpperCamelCase_						(   self      :     Dict		):
												_UpperCamelCase			     =     '''<s>'''
												_UpperCamelCase			     =     1

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







							def  UpperCamelCase_						(   self      :     Any		):
												_UpperCamelCase			     =     list(self.get_tokenizer().get_vocab().keys()		)

												self.assertEqual(vocab_keys[0] ,			'''<unk>'''		)
												self.assertEqual(vocab_keys[1] ,			'''<s>'''		)
												self.assertEqual(vocab_keys[-1] ,			'''<pad>'''		)
												self.assertEqual(len(_A		) ,			1002		)







							def  UpperCamelCase_						(   self      :     Dict		):
												self.assertEqual(self.get_tokenizer().vocab_size ,			1000		)







							def  UpperCamelCase_						(   self      :     int		):
												_UpperCamelCase			     =     BertGenerationTokenizer(_A ,			keep_accents=_A		)

												_UpperCamelCase			     =     tokenizer.tokenize('''This is a test'''		)
												self.assertListEqual(_A ,			['''▁This''', '''▁is''', '''▁a''', '''▁t''', '''est''']		)

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

												_UpperCamelCase			     =     tokenizer.tokenize('''I was born in 92000, and this is falsé.'''		)
												self.assertListEqual(
												    _A ,			[
												        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''',
												        '''é''',
												        '''.''',
												    ] ,			)
												_UpperCamelCase			     =     tokenizer.convert_tokens_to_ids(_A		)
												self.assertListEqual(
												    _A ,			[8, 21, 84, 55, 24, 19, 7, 0, 602, 347, 347, 347, 3, 12, 66, 46, 72, 80, 6, 0, 4] ,			)

												_UpperCamelCase			     =     tokenizer.convert_ids_to_tokens(_A		)
												self.assertListEqual(
												    _A ,			[
												        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      :     Union[str, Any]		):
												return BertGenerationTokenizer.from_pretrained('''google/bert_for_seq_generation_L-24_bbc_encoder'''		)







							@slow
							def  UpperCamelCase_						(   self      :     Optional[Any]		):
												_UpperCamelCase			     =     '''Hello World!'''
												_UpperCamelCase			     =     [1_8536, 2260, 101]

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







							@slow
							def  UpperCamelCase_						(   self      :     int		):
												_UpperCamelCase			     =     (
												    '''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'''
												)
												_UpperCamelCase			     =     [
												    871,
												    419,
												    358,
												    946,
												    991,
												    2521,
												    452,
												    358,
												    1357,
												    387,
												    7751,
												    3536,
												    112,
												    985,
												    456,
												    126,
												    865,
												    938,
												    5400,
												    5734,
												    458,
												    1368,
												    467,
												    786,
												    2462,
												    5246,
												    1159,
												    633,
												    865,
												    4519,
												    457,
												    582,
												    852,
												    2557,
												    427,
												    916,
												    508,
												    405,
												    3_4324,
												    497,
												    391,
												    408,
												    1_1342,
												    1244,
												    385,
												    100,
												    938,
												    985,
												    456,
												    574,
												    362,
												    1_2597,
												    3200,
												    3129,
												    1172,
												]

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







							@require_torch
							@slow
							def  UpperCamelCase_						(   self      :     Dict		):
												import torch

												from transformers import BertGenerationConfig, BertGenerationEncoder

												# Build sequence
												_UpperCamelCase			     =     list(self.big_tokenizer.get_vocab().keys()		)[:10]
												_UpperCamelCase			     =     ''' '''.join(_A		)
												_UpperCamelCase			     =     self.big_tokenizer.encode_plus(_A ,			return_tensors='''pt''' ,			return_token_type_ids=_A		)
												_UpperCamelCase			     =     self.big_tokenizer.batch_encode_plus(
												    [sequence + ''' ''' + sequence] ,			return_tensors='''pt''' ,			return_token_type_ids=_A		)

												_UpperCamelCase			     =     BertGenerationConfig()
												_UpperCamelCase			     =     BertGenerationEncoder(_A		)

												assert model.get_input_embeddings().weight.shape[0] >= self.big_tokenizer.vocab_size

												with torch.no_grad():
																	model(**_A		)
																	model(**_A		)







							@slow
							def  UpperCamelCase_						(   self      :     Dict		):
												# fmt: off
												_UpperCamelCase			     =     {'''input_ids''': [[3_9286, 458, 3_6335, 2001, 456, 1_3073, 1_3266, 455, 113, 7746, 1741, 1_1157, 391, 1_3073, 1_3266, 455, 113, 3967, 3_5412, 113, 4936, 109, 3870, 2377, 113, 3_0084, 4_5720, 458, 134, 1_7496, 112, 503, 1_1672, 113, 118, 112, 5665, 1_3347, 3_8687, 112, 1496, 3_1389, 112, 3268, 4_7264, 134, 962, 112, 1_6377, 8035, 2_3130, 430, 1_2169, 1_5518, 2_8592, 458, 146, 4_1697, 109, 391, 1_2169, 1_5518, 1_6689, 458, 146, 4_1358, 109, 452, 726, 4034, 111, 763, 3_5412, 5082, 388, 1903, 111, 9051, 391, 2870, 4_8918, 1900, 1123, 550, 998, 112, 9586, 1_5985, 455, 391, 410, 2_2955, 3_7636, 114], [448, 1_7496, 419, 3663, 385, 763, 113, 2_7533, 2870, 3283, 1_3043, 1639, 2_4713, 523, 656, 2_4013, 1_8550, 2521, 517, 2_7014, 2_1244, 420, 1212, 1465, 391, 927, 4833, 388, 578, 1_1786, 114, 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], [484, 2169, 7687, 2_1932, 1_8146, 726, 363, 1_7032, 3391, 114, 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, 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, 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=_A ,			model_name='''google/bert_for_seq_generation_L-24_bbc_encoder''' ,			revision='''c817d1fd1be2ffa69431227a1fe320544943d4db''' ,			)
