
import gc
import random
import tempfile
import unittest

import numpy as np
import torch
from PIL import Image
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMInverseScheduler,
    DDIMScheduler,
    DPMSolverMultistepInverseScheduler,
    DPMSolverMultistepScheduler,
    StableDiffusionDiffEditPipeline,
    UNetaDConditionModel,
)
from diffusers.utils import load_image, slow
from diffusers.utils.testing_utils import enable_full_determinism, floats_tensor, require_torch_gpu, torch_device

from ..pipeline_params import TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS, TEXT_GUIDED_IMAGE_INPAINTING_PARAMS
from ..test_pipelines_common import PipelineLatentTesterMixin, PipelineTesterMixin


enable_full_determinism()




class  lowerCamelCase__							(				__lowercase     ,						__lowercase     ,						unittest.TestCase):




	'''simple docstring'''




	_A								=     StableDiffusionDiffEditPipeline
	_A								=     TEXT_GUIDED_IMAGE_INPAINTING_PARAMS - {'height', 'width', 'image'} | {'image_latents'}
	_A								=     TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS - {'image'} | {'image_latents'}
	_A								=     frozenset(
	    [])  # TO-DO: update image_params once pipeline is refactored with VaeImageProcessor.preprocess
	_A								=     frozenset([])







	def    _lowerCamelCase				(					self		:str						)		-> Optional[int]:
								torch.manual_seed(0						)
								__UpperCamelCase	:   Dict			   =					UNetaDConditionModel(
								    block_out_channels=(3_2, 6_4)     ,   layers_per_block=2     ,   sample_size=3_2     ,   in_channels=4     ,   out_channels=4     ,   down_block_types=("DownBlock2D", "CrossAttnDownBlock2D")     ,   up_block_types=("CrossAttnUpBlock2D", "UpBlock2D")     ,   cross_attention_dim=3_2     ,   attention_head_dim=(2, 4)     ,   use_linear_projection=a     ,   )
								__UpperCamelCase	:   int			   =					DDIMScheduler(
								    beta_start=0.00085     ,   beta_end=0.012     ,   beta_schedule="scaled_linear"     ,   clip_sample=a     ,   set_alpha_to_one=a     ,   )
								__UpperCamelCase	:   List[Any]			   =					DDIMInverseScheduler(
								    beta_start=0.00085     ,   beta_end=0.012     ,   beta_schedule="scaled_linear"     ,   clip_sample=a     ,   set_alpha_to_zero=a     ,   )
								torch.manual_seed(0						)
								__UpperCamelCase	:   int			   =					AutoencoderKL(
								    block_out_channels=[3_2, 6_4]     ,   in_channels=3     ,   out_channels=3     ,   down_block_types=["DownEncoderBlock2D", "DownEncoderBlock2D"]     ,   up_block_types=["UpDecoderBlock2D", "UpDecoderBlock2D"]     ,   latent_channels=4     ,   sample_size=1_2_8     ,   )
								torch.manual_seed(0						)
								__UpperCamelCase	:   Optional[int]			   =					CLIPTextConfig(
								    bos_token_id=0     ,   eos_token_id=2     ,   hidden_size=3_2     ,   intermediate_size=3_7     ,   layer_norm_eps=1E-0_5     ,   num_attention_heads=4     ,   num_hidden_layers=5     ,   pad_token_id=1     ,   vocab_size=1_0_0_0     ,   hidden_act="gelu"     ,   projection_dim=5_1_2     ,   )
								__UpperCamelCase	:   Optional[Any]			   =					CLIPTextModel(a						)
								__UpperCamelCase	:   List[str]			   =					CLIPTokenizer.from_pretrained("hf-internal-testing/tiny-random-clip"						)

								__UpperCamelCase	:   int			   =					{
								    """unet""": unet,
								    """scheduler""": scheduler,
								    """inverse_scheduler""": inverse_scheduler,
								    """vae""": vae,
								    """text_encoder""": text_encoder,
								    """tokenizer""": tokenizer,
								    """safety_checker""": None,
								    """feature_extractor""": None,
								}

								return components







	def    _lowerCamelCase				(					self		:Any     ,   a		:int     ,   a		:Any=0						)		-> Optional[Any]:
								__UpperCamelCase	:   Any			   =					floats_tensor((1, 1_6, 1_6)     ,   rng=random.Random(a						)						).to(a						)
								__UpperCamelCase	:   Any			   =					floats_tensor((1, 2, 4, 1_6, 1_6)     ,   rng=random.Random(a						)						).to(a						)
								if str(a						).startswith("mps"						):
															__UpperCamelCase	:   List[Any]			   =					torch.manual_seed(a						)
								else:
															__UpperCamelCase	:   List[Any]			   =					torch.Generator(device=a						).manual_seed(a						)
								__UpperCamelCase	:   int			   =					{
								    """prompt""": """a dog and a newt""",
								    """mask_image""": mask,
								    """image_latents""": latents,
								    """generator""": generator,
								    """num_inference_steps""": 2,
								    """inpaint_strength""": 1.0,
								    """guidance_scale""": 6.0,
								    """output_type""": """numpy""",
								}

								return inputs







	def    _lowerCamelCase				(					self		:Tuple     ,   a		:int     ,   a		:Dict=0						)		-> Optional[int]:
								__UpperCamelCase	:   Optional[Any]			   =					floats_tensor((1, 3, 3_2, 3_2)     ,   rng=random.Random(a						)						).to(a						)
								__UpperCamelCase	:   Union[str, Any]			   =					image.cpu().permute(0     ,   2     ,   3     ,   1						)[0]
								__UpperCamelCase	:   int			   =					Image.fromarray(np.uinta(a						)						).convert("RGB"						)
								if str(a						).startswith("mps"						):
															__UpperCamelCase	:   Optional[int]			   =					torch.manual_seed(a						)
								else:
															__UpperCamelCase	:   Optional[Any]			   =					torch.Generator(device=a						).manual_seed(a						)
								__UpperCamelCase	:   Any			   =					{
								    """image""": image,
								    """source_prompt""": """a cat and a frog""",
								    """target_prompt""": """a dog and a newt""",
								    """generator""": generator,
								    """num_inference_steps""": 2,
								    """num_maps_per_mask""": 2,
								    """mask_encode_strength""": 1.0,
								    """guidance_scale""": 6.0,
								    """output_type""": """numpy""",
								}

								return inputs







	def    _lowerCamelCase				(					self		:List[str]     ,   a		:Optional[Any]     ,   a		:Any=0						)		-> str:
								__UpperCamelCase	:   int			   =					floats_tensor((1, 3, 3_2, 3_2)     ,   rng=random.Random(a						)						).to(a						)
								__UpperCamelCase	:   str			   =					image.cpu().permute(0     ,   2     ,   3     ,   1						)[0]
								__UpperCamelCase	:   int			   =					Image.fromarray(np.uinta(a						)						).convert("RGB"						)
								if str(a						).startswith("mps"						):
															__UpperCamelCase	:   Optional[int]			   =					torch.manual_seed(a						)
								else:
															__UpperCamelCase	:   Optional[int]			   =					torch.Generator(device=a						).manual_seed(a						)
								__UpperCamelCase	:   str			   =					{
								    """image""": image,
								    """prompt""": """a cat and a frog""",
								    """generator""": generator,
								    """num_inference_steps""": 2,
								    """inpaint_strength""": 1.0,
								    """guidance_scale""": 6.0,
								    """decode_latents""": True,
								    """output_type""": """numpy""",
								}
								return inputs







	def    _lowerCamelCase				(					self		:Optional[Any]						)		-> List[Any]:
								if not hasattr(self.pipeline_class     ,   "_optional_components"						):
															return

								__UpperCamelCase	:   Dict			   =					self.get_dummy_components()
								__UpperCamelCase	:   int			   =					self.pipeline_class(**a						)
								pipe.to(a						)
								pipe.set_progress_bar_config(disable=a						)

								# set all optional components to None and update pipeline config accordingly
								for optional_component in pipe._optional_components:
															setattr(a     ,   a     ,   a						)
								pipe.register_modules(**{optional_component: None for optional_component in pipe._optional_components}						)

								__UpperCamelCase	:   Any			   =					self.get_dummy_inputs(a						)
								__UpperCamelCase	:   Optional[Any]			   =					pipe(**a						)[0]

								with tempfile.TemporaryDirectory() as tmpdir:
															pipe.save_pretrained(a						)
															__UpperCamelCase	:   Dict			   =					self.pipeline_class.from_pretrained(a						)
															pipe_loaded.to(a						)
															pipe_loaded.set_progress_bar_config(disable=a						)

								for optional_component in pipe._optional_components:
															self.assertTrue(
															    getattr(a     ,   a						) is None     ,   f'`{optional_component}` did not stay set to None after loading.'     ,   )

								__UpperCamelCase	:   Union[str, Any]			   =					self.get_dummy_inputs(a						)
								__UpperCamelCase	:   Tuple			   =					pipe_loaded(**a						)[0]

								__UpperCamelCase	:   Optional[Any]			   =					np.abs(output - output_loaded						).max()
								self.assertLess(a     ,   1E-4						)







	def    _lowerCamelCase				(					self		:int						)		-> Optional[int]:
								__UpperCamelCase	:   Optional[int]			   =					"""cpu"""

								__UpperCamelCase	:   Optional[Any]			   =					self.get_dummy_components()
								__UpperCamelCase	:   List[str]			   =					self.pipeline_class(**a						)
								pipe.to(a						)
								pipe.set_progress_bar_config(disable=a						)

								__UpperCamelCase	:   Union[str, Any]			   =					self.get_dummy_mask_inputs(a						)
								__UpperCamelCase	:   List[Any]			   =					pipe.generate_mask(**a						)
								__UpperCamelCase	:   Dict			   =					mask[0, -3:, -3:]

								self.assertEqual(mask.shape     ,   (1, 1_6, 1_6)						)
								__UpperCamelCase	:   Optional[int]			   =					np.array([0] * 9						)
								__UpperCamelCase	:   Union[str, Any]			   =					np.abs(mask_slice.flatten() - expected_slice						).max()
								self.assertLessEqual(a     ,   1E-3						)
								self.assertEqual(mask[0, -3, -4]     ,   0						)







	def    _lowerCamelCase				(					self		:int						)		-> Optional[Any]:
								__UpperCamelCase	:   Optional[Any]			   =					"""cpu"""

								__UpperCamelCase	:   List[str]			   =					self.get_dummy_components()
								__UpperCamelCase	:   Optional[Any]			   =					self.pipeline_class(**a						)
								pipe.to(a						)
								pipe.set_progress_bar_config(disable=a						)

								__UpperCamelCase	:   Optional[int]			   =					self.get_dummy_inversion_inputs(a						)
								__UpperCamelCase	:   List[str]			   =					pipe.invert(**a						).images
								__UpperCamelCase	:   Union[str, Any]			   =					image[0, -1, -3:, -3:]

								self.assertEqual(image.shape     ,   (2, 3_2, 3_2, 3)						)
								__UpperCamelCase	:   Dict			   =					np.array(
								    [0.5150, 0.5134, 0.5043, 0.5376, 0.4694, 0.51050, 0.5015, 0.4407, 0.4799]     ,   )
								__UpperCamelCase	:   Dict			   =					np.abs(image_slice.flatten() - expected_slice						).max()
								self.assertLessEqual(a     ,   1E-3						)







	def    _lowerCamelCase				(					self		:Union[str, Any]						)		-> Dict:
								super().test_inference_batch_single_identical(expected_max_diff=5E-3						)







	def    _lowerCamelCase				(					self		:int						)		-> int:
								__UpperCamelCase	:   List[Any]			   =					"""cpu"""

								__UpperCamelCase	:   int			   =					self.get_dummy_components()

								__UpperCamelCase	:   List[Any]			   =					{"""beta_start""": 0.00085, """beta_end""": 0.012, """beta_schedule""": """scaled_linear"""}
								__UpperCamelCase	:   int			   =					DPMSolverMultistepScheduler(**a						)
								__UpperCamelCase	:   int			   =					DPMSolverMultistepInverseScheduler(**a						)

								__UpperCamelCase	:   List[str]			   =					self.pipeline_class(**a						)
								pipe.to(a						)
								pipe.set_progress_bar_config(disable=a						)

								__UpperCamelCase	:   Tuple			   =					self.get_dummy_inversion_inputs(a						)
								__UpperCamelCase	:   Any			   =					pipe.invert(**a						).images
								__UpperCamelCase	:   Dict			   =					image[0, -1, -3:, -3:]

								self.assertEqual(image.shape     ,   (2, 3_2, 3_2, 3)						)
								__UpperCamelCase	:   Any			   =					np.array(
								    [0.5150, 0.5134, 0.5043, 0.5376, 0.4694, 0.51050, 0.5015, 0.4407, 0.4799]     ,   )
								__UpperCamelCase	:   Optional[int]			   =					np.abs(image_slice.flatten() - expected_slice						).max()
								self.assertLessEqual(a     ,   1E-3						)




@require_torch_gpu
@slow
class  lowerCamelCase__							(				unittest.TestCase):




	'''simple docstring'''




	def    _lowerCamelCase				(					self		:Dict						)		-> int:
								super().tearDown()
								gc.collect()
								torch.cuda.empty_cache()







	@classmethod
	def    _lowerCamelCase				(					cls		:Optional[int]						)		-> Dict:
								__UpperCamelCase	:   Tuple			   =					load_image(
								    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/diffedit/fruit.png"						)

								__UpperCamelCase	:   Union[str, Any]			   =					raw_image.convert("RGB"						).resize((7_6_8, 7_6_8)						)

								__UpperCamelCase	:   List[str]			   =					raw_image







	def    _lowerCamelCase				(					self		:Optional[int]						)		-> Optional[Any]:
								__UpperCamelCase	:   Dict			   =					torch.manual_seed(0						)

								__UpperCamelCase	:   int			   =					StableDiffusionDiffEditPipeline.from_pretrained(
								    "stabilityai/stable-diffusion-2-1"     ,   safety_checker=a     ,   torch_dtype=torch.floataa						)
								__UpperCamelCase	:   Optional[int]			   =					DDIMScheduler.from_config(pipe.scheduler.config						)
								__UpperCamelCase	:   Optional[int]			   =					DDIMInverseScheduler.from_config(pipe.scheduler.config						)
								pipe.enable_model_cpu_offload()
								pipe.set_progress_bar_config(disable=a						)

								__UpperCamelCase	:   Tuple			   =					"""a bowl of fruit"""
								__UpperCamelCase	:   List[Any]			   =					"""a bowl of pears"""

								__UpperCamelCase	:   str			   =					pipe.generate_mask(
								    image=self.raw_image     ,   source_prompt=a     ,   target_prompt=a     ,   generator=a     ,   )

								__UpperCamelCase	:   Tuple			   =					pipe.invert(
								    prompt=a     ,   image=self.raw_image     ,   inpaint_strength=0.7     ,   generator=a						).latents

								__UpperCamelCase	:   Any			   =					pipe(
								    prompt=a     ,   mask_image=a     ,   image_latents=a     ,   generator=a     ,   negative_prompt=a     ,   inpaint_strength=0.7     ,   output_type="numpy"     ,   ).images[0]

								__UpperCamelCase	:   List[str]			   =					(
								    np.array(
								        load_image(
								            "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
								            "/diffedit/pears.png"						).resize((7_6_8, 7_6_8)						)						)
								    / 2_5_5
								)
								assert np.abs((expected_image - image).max()						) < 5E-1







	def    _lowerCamelCase				(					self		:Union[str, Any]						)		-> Optional[Any]:
								__UpperCamelCase	:   Optional[Any]			   =					torch.manual_seed(0						)

								__UpperCamelCase	:   Union[str, Any]			   =					StableDiffusionDiffEditPipeline.from_pretrained(
								    "stabilityai/stable-diffusion-2-1"     ,   safety_checker=a     ,   torch_dtype=torch.floataa						)
								__UpperCamelCase	:   List[str]			   =					DPMSolverMultistepScheduler.from_config(pipe.scheduler.config						)
								__UpperCamelCase	:   Any			   =					DPMSolverMultistepInverseScheduler.from_config(pipe.scheduler.config						)
								pipe.enable_model_cpu_offload()
								pipe.set_progress_bar_config(disable=a						)

								__UpperCamelCase	:   int			   =					"""a bowl of fruit"""
								__UpperCamelCase	:   int			   =					"""a bowl of pears"""

								__UpperCamelCase	:   str			   =					pipe.generate_mask(
								    image=self.raw_image     ,   source_prompt=a     ,   target_prompt=a     ,   generator=a     ,   )

								__UpperCamelCase	:   Any			   =					pipe.invert(
								    prompt=a     ,   image=self.raw_image     ,   inpaint_strength=0.7     ,   generator=a     ,   num_inference_steps=2_5     ,   ).latents

								__UpperCamelCase	:   str			   =					pipe(
								    prompt=a     ,   mask_image=a     ,   image_latents=a     ,   generator=a     ,   negative_prompt=a     ,   inpaint_strength=0.7     ,   num_inference_steps=2_5     ,   output_type="numpy"     ,   ).images[0]

								__UpperCamelCase	:   Tuple			   =					(
								    np.array(
								        load_image(
								            "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
								            "/diffedit/pears.png"						).resize((7_6_8, 7_6_8)						)						)
								    / 2_5_5
								)
								assert np.abs((expected_image - image).max()						) < 5E-1




'''simple docstring'''




import unittest

from transformers import AlbertTokenizer, AlbertTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin


a   :			Any					  =    get_tests_dir("""fixtures/spiece.model""")

@require_sentencepiece
@require_tokenizers
class 			UpperCamelCase_ (							__magic_name__      ,     unittest.TestCase			):
	lowercase          = AlbertTokenizer
	lowercase          = AlbertTokenizerFast
	lowercase          = True
	lowercase          = True
	lowercase          = True





	def  _lowercase(  self    )			->			str:
								super().setUp()

								# We have a SentencePiece fixture for testing
								UpperCAmelCase     :		Optional[int]							     =		AlbertTokenizer(A    )
								tokenizer.save_pretrained(self.tmpdirname    )





	def  _lowercase(  self		,		A    )			->			int:
								UpperCAmelCase     :		Optional[int]							     =		"""this is a test"""
								UpperCAmelCase     :		Dict							     =		"""this is a test"""
								return input_text, output_text





	def  _lowercase(  self    )			->			int:
								UpperCAmelCase     :		Tuple							     =		"""<pad>"""
								UpperCAmelCase     :		Optional[int]							     =		0

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





	def  _lowercase(  self    )			->			Any:
								UpperCAmelCase     :		str							     =		list(self.get_tokenizer().get_vocab().keys()    )

								self.assertEqual(vocab_keys[0]		,		"""<pad>"""    )
								self.assertEqual(vocab_keys[1]		,		"""<unk>"""    )
								self.assertEqual(vocab_keys[-1]		,		"""▁eloquent"""    )
								self.assertEqual(len(A    )		,		30000    )





	def  _lowercase(  self    )			->			Tuple:
								self.assertEqual(self.get_tokenizer().vocab_size		,		30000    )





	def  _lowercase(  self    )			->			Union[str, Any]:
								if not self.test_rust_tokenizer:
															return

								UpperCAmelCase     :		int							     =		self.get_tokenizer()
								UpperCAmelCase     :		List[str]							     =		self.get_rust_tokenizer()

								UpperCAmelCase     :		Optional[Any]							     =		"""I was born in 92000, and this is falsé."""

								UpperCAmelCase     :		str							     =		tokenizer.tokenize(A    )
								UpperCAmelCase     :		Optional[int]							     =		rust_tokenizer.tokenize(A    )
								self.assertListEqual(A		,		A    )

								UpperCAmelCase     :		Any							     =		tokenizer.encode(A		,		add_special_tokens=A    )
								UpperCAmelCase     :		Optional[int]							     =		rust_tokenizer.encode(A		,		add_special_tokens=A    )
								self.assertListEqual(A		,		A    )

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





	def  _lowercase(  self    )			->			Any:
								UpperCAmelCase     :		List[Any]							     =		AlbertTokenizer(A		,		keep_accents=A    )

								UpperCAmelCase     :		Optional[int]							     =		tokenizer.tokenize("""This is a test"""    )
								self.assertListEqual(A		,		["""▁this""", """▁is""", """▁a""", """▁test"""]    )

								self.assertListEqual(tokenizer.convert_tokens_to_ids(A    )		,		[48, 25, 21, 1289]    )

								UpperCAmelCase     :		Optional[Any]							     =		tokenizer.tokenize("""I was born in 92000, and this is falsé."""    )
								self.assertListEqual(
								    A		,		["""▁i""", """▁was""", """▁born""", """▁in""", """▁9""", """2000""", """,""", """▁and""", """▁this""", """▁is""", """▁fal""", """s""", """é""", """."""]    )
								UpperCAmelCase     :		str							     =		tokenizer.convert_tokens_to_ids(A    )
								self.assertListEqual(A		,		[31, 23, 386, 19, 561, 3050, 15, 17, 48, 25, 8256, 18, 1, 9]    )

								UpperCAmelCase     :		List[str]							     =		tokenizer.convert_ids_to_tokens(A    )
								self.assertListEqual(
								    A		,		["""▁i""", """▁was""", """▁born""", """▁in""", """▁9""", """2000""", """,""", """▁and""", """▁this""", """▁is""", """▁fal""", """s""", """<unk>""", """."""]		,		)





	def  _lowercase(  self    )			->			Optional[Any]:
								UpperCAmelCase     :		str							     =		AlbertTokenizer(A    )

								UpperCAmelCase     :		Optional[int]							     =		tokenizer.encode("""sequence builders"""    )
								UpperCAmelCase     :		Any							     =		tokenizer.encode("""multi-sequence build"""    )

								UpperCAmelCase     :		Optional[Any]							     =		tokenizer.build_inputs_with_special_tokens(A    )
								UpperCAmelCase     :		List[str]							     =		tokenizer.build_inputs_with_special_tokens(A		,		A    )

								assert encoded_sentence == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id]
								assert encoded_pair == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_a + [
								    tokenizer.sep_token_id
								]






	@slow
	def  _lowercase(  self    )			->			Dict:
								# fmt: off
								UpperCAmelCase     :		Tuple							     =		{"""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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], """input_ids""": [[2, 21970, 13, 5, 6092, 167, 28, 7103, 2153, 673, 8, 7028, 12051, 18, 17, 7103, 2153, 673, 8, 3515, 18684, 8, 4461, 6, 1927, 297, 8, 12060, 2607, 18, 13, 5, 4461, 15, 10538, 38, 8, 135, 15, 822, 58, 15, 993, 10363, 15, 1460, 8005, 4461, 15, 993, 255, 2328, 9, 9, 9, 6, 26, 1112, 816, 3260, 13, 5, 103, 2377, 6, 17, 1112, 816, 2782, 13, 5, 103, 10641, 6, 29, 84, 2512, 2430, 782, 18684, 2761, 19, 808, 2430, 2556, 17, 855, 1480, 9477, 4091, 128, 11712, 15, 7103, 2153, 673, 17, 24883, 9990, 9, 3], [2, 11502, 25, 1006, 20, 782, 8, 11809, 855, 1732, 19393, 18667, 37, 367, 21018, 69, 1854, 34, 11860, 19124, 27, 156, 225, 17, 193, 4141, 19, 65, 9124, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 14, 2231, 886, 2385, 17659, 84, 14, 16792, 1952, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], """token_type_ids""": [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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="""albert-base-v2"""		,		revision="""6b6560eaf5ff2e250b00c50f380c5389a9c2d82e"""		,		)

