import copy
import inspect
import unittest

import numpy as np
from huggingface_hub import hf_hub_download

from transformers import TimesformerConfig
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
       import torch
       from torch import nn

       from transformers import (
           MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING,
           TimesformerForVideoClassification,
           TimesformerModel,
       )
       from transformers.models.timesformer.modeling_timesformer import TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
       from transformers import VideoMAEImageProcessor


class 			UpperCAmelCase__    :



  """simple docstring"""






  def __init__(				self:			Optional[Any]				,				__lowerCAmelCase:			List[str]				,				__lowerCAmelCase:			Dict=13				,				__lowerCAmelCase:			List[Any]=10				,				__lowerCAmelCase:			Union[str, Any]=3				,				__lowerCAmelCase:			Union[str, Any]=2				,				__lowerCAmelCase:			Union[str, Any]=2				,				__lowerCAmelCase:			Any=True				,				__lowerCAmelCase:			Optional[int]=True				,				__lowerCAmelCase:			Union[str, Any]=32				,				__lowerCAmelCase:			Optional[int]=5				,				__lowerCAmelCase:			Dict=4				,				__lowerCAmelCase:			List[Any]=37				,				__lowerCAmelCase:			Any="gelu"				,				__lowerCAmelCase:			Tuple=0.1				,				__lowerCAmelCase:			List[Any]=0.1				,				__lowerCAmelCase:			Dict=10				,				__lowerCAmelCase:			Optional[Any]=0.02				,				__lowerCAmelCase:			Dict="divided_space_time"				,				__lowerCAmelCase:			Union[str, Any]=None				,				) -> List[str]:




    '''simple docstring'''




    __UpperCAmelCase						    =       parent
    __UpperCAmelCase						    =       batch_size
    __UpperCAmelCase						    =       image_size
    __UpperCAmelCase						    =       num_channels
    __UpperCAmelCase						    =       patch_size
    __UpperCAmelCase						    =       num_frames
    __UpperCAmelCase						    =       is_training
    __UpperCAmelCase						    =       use_labels
    __UpperCAmelCase						    =       hidden_size
    __UpperCAmelCase						    =       num_hidden_layers
    __UpperCAmelCase						    =       num_attention_heads
    __UpperCAmelCase						    =       intermediate_size
    __UpperCAmelCase						    =       hidden_act
    __UpperCAmelCase						    =       hidden_dropout_prob
    __UpperCAmelCase						    =       attention_probs_dropout_prob
    __UpperCAmelCase						    =       attention_type
    __UpperCAmelCase						    =       initializer_range
    __UpperCAmelCase						    =       scope
    __UpperCAmelCase						    =       num_labels

    # in TimeSformer, the number of spatial tokens equals num_frames * num_patches per frame + 1 CLS token
    __UpperCAmelCase						    =       (image_size // patch_size) ** 2
    __UpperCAmelCase						    =       (num_frames) * self.num_patches_per_frame + 1






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




    '''simple docstring'''




    __UpperCAmelCase						    =       floats_tensor(
        [self.batch_size, self.num_frames, self.num_channels, self.image_size, self.image_size]   )

    __UpperCAmelCase						    =       None
    if self.use_labels:
      __UpperCAmelCase						    =       ids_tensor([self.batch_size]				,				self.num_labels   )

    __UpperCAmelCase						    =       self.get_config()

    return config, pixel_values, labels






  def 	_UpperCAmelCase				(				self:			Tuple   ) -> List[str]:




    '''simple docstring'''




    __UpperCAmelCase						    =       TimesformerConfig(
        image_size=self.image_size				,				patch_size=self.patch_size				,				num_channels=self.num_channels				,				num_frames=self.num_frames				,				hidden_size=self.hidden_size				,				num_hidden_layers=self.num_hidden_layers				,				num_attention_heads=self.num_attention_heads				,				intermediate_size=self.intermediate_size				,				hidden_act=self.hidden_act				,				hidden_dropout_prob=self.hidden_dropout_prob				,				attention_probs_dropout_prob=self.attention_probs_dropout_prob				,				initializer_range=self.initializer_range				,				attention_type=self.attention_type				,				)
    __UpperCAmelCase						    =       self.num_labels
    return config






  def 	_UpperCAmelCase				(				self:			Dict				,				__lowerCAmelCase:			int				,				__lowerCAmelCase:			Tuple				,				__lowerCAmelCase:			Union[str, Any]   ) -> str:




    '''simple docstring'''




    __UpperCAmelCase						    =       TimesformerModel(config=__lowerCAmelCase   )
    model.to(__lowerCAmelCase   )
    model.eval()
    __UpperCAmelCase						    =       model(__lowerCAmelCase   )
    self.parent.assertEqual(result.last_hidden_state.shape				,				(self.batch_size, self.seq_length, self.hidden_size)   )






  def 	_UpperCAmelCase				(				self:			str				,				__lowerCAmelCase:			Union[str, Any]				,				__lowerCAmelCase:			Dict				,				__lowerCAmelCase:			Dict   ) -> Optional[int]:




    '''simple docstring'''




    __UpperCAmelCase						    =       TimesformerForVideoClassification(__lowerCAmelCase   )
    model.to(__lowerCAmelCase   )
    model.eval()

    __UpperCAmelCase						    =       model(__lowerCAmelCase   )

    # verify the logits shape
    __UpperCAmelCase						    =       torch.Size((self.batch_size, self.num_labels)   )
    self.parent.assertEqual(result.logits.shape				,				__lowerCAmelCase   )






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




    '''simple docstring'''




    __UpperCAmelCase						    =       self.prepare_config_and_inputs()
    __UpperCAmelCase    ,		__UpperCAmelCase    ,		__UpperCAmelCase						    =       config_and_inputs
    __UpperCAmelCase						    =       {"pixel_values": pixel_values}
    return config, inputs_dict






@require_torch
class 			UpperCAmelCase__    (		snake_case		,	snake_case		,	unittest.TestCase					):



  """simple docstring"""






  lowerCAmelCase__		:	List[Any]    		= (TimesformerModel, TimesformerForVideoClassification) if is_torch_available() else ()
  lowerCAmelCase__		:	List[str]    		= (
      {'feature-extraction': TimesformerModel, 'video-classification': TimesformerForVideoClassification}
      if is_torch_available()
      else {}
  )

  lowerCAmelCase__		:	List[str]    		= False
  lowerCAmelCase__		:	Dict    		= False
  lowerCAmelCase__		:	Tuple    		= False
  lowerCAmelCase__		:	Union[str, Any]    		= False






  def 	_UpperCAmelCase				(				self:			int   ) -> Tuple:




    '''simple docstring'''




    __UpperCAmelCase						    =       TimesformerModelTester(self   )
    __UpperCAmelCase						    =       ConfigTester(
        self				,				config_class=__lowerCAmelCase				,				has_text_modality=__lowerCAmelCase				,				hidden_size=37   )






  def 	_UpperCAmelCase				(				self:			List[Any]				,				__lowerCAmelCase:			List[str]				,				__lowerCAmelCase:			List[str]				,				__lowerCAmelCase:			Optional[int]=False   ) -> List[Any]:




    '''simple docstring'''




    __UpperCAmelCase						    =       copy.deepcopy(__lowerCAmelCase   )

    if return_labels:
      if model_class in get_values(__lowerCAmelCase   ):
        __UpperCAmelCase						    =       torch.zeros(
            self.model_tester.batch_size				,				dtype=torch.long				,				device=__lowerCAmelCase   )

    return inputs_dict






  def 	_UpperCAmelCase				(				self:			Optional[Any]   ) -> Optional[Any]:




    '''simple docstring'''




    self.config_tester.run_common_tests()






  @unittest.skip(reason="TimeSformer does not use inputs_embeds"   )
  def 	_UpperCAmelCase				(				self:			Dict   ) -> Union[str, Any]:




    '''simple docstring'''




    pass






  def 	_UpperCAmelCase				(				self:			Tuple   ) -> List[Any]:




    '''simple docstring'''




    __UpperCAmelCase    ,		__UpperCAmelCase						    =       self.model_tester.prepare_config_and_inputs_for_common()

    for model_class in self.all_model_classes:
      __UpperCAmelCase						    =       model_class(__lowerCAmelCase   )
      self.assertIsInstance(model.get_input_embeddings()				,				(nn.Module)   )
      __UpperCAmelCase						    =       model.get_output_embeddings()
      self.assertTrue(x is None or isinstance(__lowerCAmelCase				,				nn.Linear   )   )






  def 	_UpperCAmelCase				(				self:			List[Any]   ) -> str:




    '''simple docstring'''




    __UpperCAmelCase    ,		__UpperCAmelCase						    =       self.model_tester.prepare_config_and_inputs_for_common()

    for model_class in self.all_model_classes:
      __UpperCAmelCase						    =       model_class(__lowerCAmelCase   )
      __UpperCAmelCase						    =       inspect.signature(model.forward   )
      # signature.parameters is an OrderedDict => so arg_names order is deterministic
      __UpperCAmelCase						    =       [*signature.parameters.keys()]

      __UpperCAmelCase						    =       ["pixel_values"]
      self.assertListEqual(arg_names[:1]				,				__lowerCAmelCase   )






  def 	_UpperCAmelCase				(				self:			Tuple   ) -> Dict:




    '''simple docstring'''




    __UpperCAmelCase						    =       self.model_tester.prepare_config_and_inputs()
    self.model_tester.create_and_check_model(*__lowerCAmelCase   )






  def 	_UpperCAmelCase				(				self:			Tuple   ) -> Tuple:




    '''simple docstring'''




    __UpperCAmelCase						    =       self.model_tester.prepare_config_and_inputs()
    self.model_tester.create_and_check_for_video_classification(*__lowerCAmelCase   )






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




    '''simple docstring'''




    for model_name in TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
      __UpperCAmelCase						    =       TimesformerModel.from_pretrained(__lowerCAmelCase   )
      self.assertIsNotNone(__lowerCAmelCase   )






  def 	_UpperCAmelCase				(				self:			Optional[Any]   ) -> Optional[Any]:




    '''simple docstring'''




    if not self.has_attentions:
      pass

    else:
      __UpperCAmelCase    ,		__UpperCAmelCase						    =       self.model_tester.prepare_config_and_inputs_for_common()
      __UpperCAmelCase						    =       True

      for model_class in self.all_model_classes:
        __UpperCAmelCase						    =       self.model_tester.seq_length
        __UpperCAmelCase						    =       self.model_tester.num_frames

        __UpperCAmelCase						    =       True
        __UpperCAmelCase						    =       False
        __UpperCAmelCase						    =       True
        __UpperCAmelCase						    =       model_class(__lowerCAmelCase   )
        model.to(__lowerCAmelCase   )
        model.eval()
        with torch.no_grad():
          __UpperCAmelCase						    =       model(**self._prepare_for_class(__lowerCAmelCase				,				__lowerCAmelCase   )   )
        __UpperCAmelCase						    =       outputs.attentions
        self.assertEqual(len(__lowerCAmelCase   )				,				self.model_tester.num_hidden_layers   )

        # check that output_attentions also work using config
        del inputs_dict["output_attentions"]
        __UpperCAmelCase						    =       True
        __UpperCAmelCase						    =       model_class(__lowerCAmelCase   )
        model.to(__lowerCAmelCase   )
        model.eval()
        with torch.no_grad():
          __UpperCAmelCase						    =       model(**self._prepare_for_class(__lowerCAmelCase				,				__lowerCAmelCase   )   )
        __UpperCAmelCase						    =       outputs.attentions
        self.assertEqual(len(__lowerCAmelCase   )				,				self.model_tester.num_hidden_layers   )

        # attentions has shape (batch_size x num_frames) x num_heads x (num_patches per frame + 1) x (num_patches per frame + 1)
        self.assertListEqual(
            list(attentions[0].shape[-3:]   )				,				[self.model_tester.num_attention_heads, seq_len // num_frames + 1, seq_len // num_frames + 1]				,				)
        __UpperCAmelCase						    =       len(__lowerCAmelCase   )

        # Check attention is always last and order is fine
        __UpperCAmelCase						    =       True
        __UpperCAmelCase						    =       True
        __UpperCAmelCase						    =       model_class(__lowerCAmelCase   )
        model.to(__lowerCAmelCase   )
        model.eval()
        with torch.no_grad():
          __UpperCAmelCase						    =       model(**self._prepare_for_class(__lowerCAmelCase				,				__lowerCAmelCase   )   )

        self.assertEqual(out_len + 1				,				len(__lowerCAmelCase   )   )

        __UpperCAmelCase						    =       outputs.attentions

        self.assertEqual(len(__lowerCAmelCase   )				,				self.model_tester.num_hidden_layers   )

        # attentions has shape (batch_size x num_frames) x num_heads x (num_patches per frame + 1) x (num_patches per frame + 1)
        self.assertListEqual(
            list(self_attentions[0].shape[-3:]   )				,				[self.model_tester.num_attention_heads, seq_len // num_frames + 1, seq_len // num_frames + 1]				,				)






  def 	_UpperCAmelCase				(				self:			Dict   ) -> Optional[Any]:




    '''simple docstring'''




    def check_hidden_states_output(__lowerCAmelCase:			Tuple				,				__lowerCAmelCase:			Tuple				,				__lowerCAmelCase:			str   ):
      __UpperCAmelCase						    =       model_class(__lowerCAmelCase   )
      model.to(__lowerCAmelCase   )
      model.eval()

      with torch.no_grad():
        __UpperCAmelCase						    =       model(**self._prepare_for_class(__lowerCAmelCase				,				__lowerCAmelCase   )   )

      __UpperCAmelCase						    =       outputs.hidden_states
      __UpperCAmelCase						    =       self.model_tester.num_hidden_layers + 1
      self.assertEqual(len(__lowerCAmelCase   )				,				__lowerCAmelCase   )

      __UpperCAmelCase						    =       self.model_tester.seq_length

      self.assertListEqual(
          list(hidden_states[0].shape[-2:]   )				,				[seq_length, self.model_tester.hidden_size]				,				)

    __UpperCAmelCase    ,		__UpperCAmelCase						    =       self.model_tester.prepare_config_and_inputs_for_common()

    for model_class in self.all_model_classes:
      __UpperCAmelCase						    =       True
      check_hidden_states_output(__lowerCAmelCase				,				__lowerCAmelCase				,				__lowerCAmelCase   )

      # check that output_hidden_states also work using config
      del inputs_dict["output_hidden_states"]
      __UpperCAmelCase						    =       True

      check_hidden_states_output(__lowerCAmelCase				,				__lowerCAmelCase				,				__lowerCAmelCase   )






def       __lowerCAmelCase      (						)    ->  List[str]:
  __UpperCAmelCase						    =       hf_hub_download(
      repo_id="hf-internal-testing/spaghetti-video"						,	filename="eating_spaghetti.npy"						,	repo_type="dataset"					)
  __UpperCAmelCase						    =       np.load(A_					)
  return list(A_					)





@require_torch
@require_vision
class 			UpperCAmelCase__    (		unittest.TestCase					):



  """simple docstring"""






  @cached_property
  def 	_UpperCAmelCase				(				self:			Tuple   ) -> Any:




    '''simple docstring'''




    return (
        VideoMAEImageProcessor(image_mean=[0.5, 0.5, 0.5]				,				image_std=[0.5, 0.5, 0.5]   )
        if is_vision_available()
        else None
    )






  @slow
  def 	_UpperCAmelCase				(				self:			Optional[Any]   ) -> Tuple:




    '''simple docstring'''




    __UpperCAmelCase						    =       TimesformerForVideoClassification.from_pretrained("facebook/timesformer-base-finetuned-k400"   ).to(
        __lowerCAmelCase   )

    __UpperCAmelCase						    =       self.default_image_processor
    __UpperCAmelCase						    =       prepare_video()
    __UpperCAmelCase						    =       image_processor(video[:8]				,				return_tensors="pt"   ).to(__lowerCAmelCase   )

    # forward pass
    with torch.no_grad():
      __UpperCAmelCase						    =       model(**__lowerCAmelCase   )

    # verify the logits
    __UpperCAmelCase						    =       torch.Size((1, 400)   )
    self.assertEqual(outputs.logits.shape				,				__lowerCAmelCase   )

    __UpperCAmelCase						    =       torch.tensor([-0.3016, -0.7713, -0.4205]   ).to(__lowerCAmelCase   )

    self.assertTrue(torch.allclose(outputs.logits[0, :3]				,				__lowerCAmelCase				,				atol=1E-4   )   )





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_							=      get_tests_dir("""fixtures/spiece.model""")


@require_sentencepiece
@require_tokenizers
class 			UpperCAmelCase__    (		snake_case		,	unittest.TestCase					):



  """simple docstring"""






  lowerCAmelCase__		:	List[Any]    		= AlbertTokenizer
  lowerCAmelCase__		:	int    		= AlbertTokenizerFast
  lowerCAmelCase__		:	str    		= True
  lowerCAmelCase__		:	Union[str, Any]    		= True
  lowerCAmelCase__		:	int    		= True






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




    '''simple docstring'''




    super().setUp()

    # We have a SentencePiece fixture for testing
    __UpperCAmelCase						    =       AlbertTokenizer(__lowerCAmelCase   )
    tokenizer.save_pretrained(self.tmpdirname   )






  def 	_UpperCAmelCase				(				self:			Any				,				__lowerCAmelCase:			Tuple   ) -> Union[str, Any]:




    '''simple docstring'''




    __UpperCAmelCase						    =       "this is a test"
    __UpperCAmelCase						    =       "this is a test"
    return input_text, output_text






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




    '''simple docstring'''




    __UpperCAmelCase						    =       "<pad>"
    __UpperCAmelCase						    =       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:			str   ) -> Optional[Any]:




    '''simple docstring'''




    __UpperCAmelCase						    =       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(__lowerCAmelCase   )				,				30_000   )






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




    '''simple docstring'''




    self.assertEqual(self.get_tokenizer().vocab_size				,				30_000   )






  def 	_UpperCAmelCase				(				self:			str   ) -> int:




    '''simple docstring'''




    if not self.test_rust_tokenizer:
      return

    __UpperCAmelCase						    =       self.get_tokenizer()
    __UpperCAmelCase						    =       self.get_rust_tokenizer()

    __UpperCAmelCase						    =       "I was born in 92000, and this is falsé."

    __UpperCAmelCase						    =       tokenizer.tokenize(__lowerCAmelCase   )
    __UpperCAmelCase						    =       rust_tokenizer.tokenize(__lowerCAmelCase   )
    self.assertListEqual(__lowerCAmelCase				,				__lowerCAmelCase   )

    __UpperCAmelCase						    =       tokenizer.encode(__lowerCAmelCase				,				add_special_tokens=__lowerCAmelCase   )
    __UpperCAmelCase						    =       rust_tokenizer.encode(__lowerCAmelCase				,				add_special_tokens=__lowerCAmelCase   )
    self.assertListEqual(__lowerCAmelCase				,				__lowerCAmelCase   )

    __UpperCAmelCase						    =       self.get_rust_tokenizer()
    __UpperCAmelCase						    =       tokenizer.encode(__lowerCAmelCase   )
    __UpperCAmelCase						    =       rust_tokenizer.encode(__lowerCAmelCase   )
    self.assertListEqual(__lowerCAmelCase				,				__lowerCAmelCase   )






  def 	_UpperCAmelCase				(				self:			Optional[Any]   ) -> Any:




    '''simple docstring'''




    __UpperCAmelCase						    =       AlbertTokenizer(__lowerCAmelCase				,				keep_accents=__lowerCAmelCase   )

    __UpperCAmelCase						    =       tokenizer.tokenize("This is a test"   )
    self.assertListEqual(__lowerCAmelCase				,				["▁this", "▁is", "▁a", "▁test"]   )

    self.assertListEqual(tokenizer.convert_tokens_to_ids(__lowerCAmelCase   )				,				[48, 25, 21, 1_289]   )

    __UpperCAmelCase						    =       tokenizer.tokenize("I was born in 92000, and this is falsé."   )
    self.assertListEqual(
        __lowerCAmelCase				,				["▁i", "▁was", "▁born", "▁in", "▁9", "2000", ",", "▁and", "▁this", "▁is", "▁fal", "s", "é", "."]   )
    __UpperCAmelCase						    =       tokenizer.convert_tokens_to_ids(__lowerCAmelCase   )
    self.assertListEqual(__lowerCAmelCase				,				[31, 23, 386, 19, 561, 3_050, 15, 17, 48, 25, 8_256, 18, 1, 9]   )

    __UpperCAmelCase						    =       tokenizer.convert_ids_to_tokens(__lowerCAmelCase   )
    self.assertListEqual(
        __lowerCAmelCase				,				["▁i", "▁was", "▁born", "▁in", "▁9", "2000", ",", "▁and", "▁this", "▁is", "▁fal", "s", "<unk>", "."]				,				)






  def 	_UpperCAmelCase				(				self:			str   ) -> Dict:




    '''simple docstring'''




    __UpperCAmelCase						    =       AlbertTokenizer(__lowerCAmelCase   )

    __UpperCAmelCase						    =       tokenizer.encode("sequence builders"   )
    __UpperCAmelCase						    =       tokenizer.encode("multi-sequence build"   )

    __UpperCAmelCase						    =       tokenizer.build_inputs_with_special_tokens(__lowerCAmelCase   )
    __UpperCAmelCase						    =       tokenizer.build_inputs_with_special_tokens(__lowerCAmelCase				,				__lowerCAmelCase   )

    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 	_UpperCAmelCase				(				self:			Optional[int]   ) -> str:




    '''simple docstring'''




    __UpperCAmelCase						    =       {"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, 21_970, 13, 5, 6_092, 167, 28, 7_103, 2_153, 673, 8, 7_028, 12_051, 18, 17, 7_103, 2_153, 673, 8, 3_515, 18_684, 8, 4_461, 6, 1_927, 297, 8, 12_060, 2_607, 18, 13, 5, 4_461, 15, 10_538, 38, 8, 135, 15, 822, 58, 15, 993, 10_363, 15, 1_460, 8_005, 4_461, 15, 993, 255, 2_328, 9, 9, 9, 6, 26, 1_112, 816, 3_260, 13, 5, 103, 2_377, 6, 17, 1_112, 816, 2_782, 13, 5, 103, 10_641, 6, 29, 84, 2_512, 2_430, 782, 18_684, 2_761, 19, 808, 2_430, 2_556, 17, 855, 1_480, 9_477, 4_091, 128, 11_712, 15, 7_103, 2_153, 673, 17, 24_883, 9_990, 9, 3], [2, 11_502, 25, 1_006, 20, 782, 8, 11_809, 855, 1_732, 19_393, 18_667, 37, 367, 21_018, 69, 1_854, 34, 11_860, 19_124, 27, 156, 225, 17, 193, 4_141, 19, 65, 9_124, 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, 2_231, 886, 2_385, 17_659, 84, 14, 16_792, 1_952, 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=__lowerCAmelCase				,				model_name="albert-base-v2"				,				revision="6b6560eaf5ff2e250b00c50f380c5389a9c2d82e"				,				)



