


"""simple docstring"""
import inspect
import unittest

from transformers import ViTConfig
from transformers.testing_utils import (
    require_accelerate,
    require_torch,
    require_torch_gpu,
    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 ViTForImageClassification, ViTForMaskedImageModeling, ViTModel
 from transformers.models.vit.modeling_vit import VIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
 from PIL import Image

 from transformers import ViTImageProcessor




class 	lowercase__				:





   def __init__(							self      ,   SCREAMING_SNAKE_CASE      ,   SCREAMING_SNAKE_CASE=13      ,   SCREAMING_SNAKE_CASE=30      ,   SCREAMING_SNAKE_CASE=2      ,   SCREAMING_SNAKE_CASE=3      ,   SCREAMING_SNAKE_CASE=True      ,   SCREAMING_SNAKE_CASE=True      ,   SCREAMING_SNAKE_CASE=32      ,   SCREAMING_SNAKE_CASE=5      ,   SCREAMING_SNAKE_CASE=4      ,   SCREAMING_SNAKE_CASE=37      ,   SCREAMING_SNAKE_CASE="gelu"      ,   SCREAMING_SNAKE_CASE=0.1      ,   SCREAMING_SNAKE_CASE=0.1      ,   SCREAMING_SNAKE_CASE=10      ,   SCREAMING_SNAKE_CASE=0.02      ,   SCREAMING_SNAKE_CASE=None      ,   SCREAMING_SNAKE_CASE=2      ,   )  ->  List[str]:
      _lowerCamelCase	:					List[str]   =		parent
      _lowerCamelCase	:					List[Any]   =		batch_size
      _lowerCamelCase	:					Optional[Any]   =		image_size
      _lowerCamelCase	:					str   =		patch_size
      _lowerCamelCase	:					Tuple   =		num_channels
      _lowerCamelCase	:					Union[str, Any]   =		is_training
      _lowerCamelCase	:					List[str]   =		use_labels
      _lowerCamelCase	:					int   =		hidden_size
      _lowerCamelCase	:					Optional[Any]   =		num_hidden_layers
      _lowerCamelCase	:					Optional[Any]   =		num_attention_heads
      _lowerCamelCase	:					List[str]   =		intermediate_size
      _lowerCamelCase	:					List[str]   =		hidden_act
      _lowerCamelCase	:					Any   =		hidden_dropout_prob
      _lowerCamelCase	:					Tuple   =		attention_probs_dropout_prob
      _lowerCamelCase	:					Dict   =		type_sequence_label_size
      _lowerCamelCase	:					Dict   =		initializer_range
      _lowerCamelCase	:					Tuple   =		scope
      _lowerCamelCase	:					Tuple   =		encoder_stride

      # in ViT, the seq length equals the number of patches + 1 (we add 1 for the [CLS] token)
      _lowerCamelCase	:					Tuple   =		(image_size // patch_size) ** 2
      _lowerCamelCase	:					int   =		num_patches + 1





   def 		UpperCamelCase_  (							self)  ->  List[Any]:
      _lowerCamelCase	:					Optional[Any]   =		floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size])

      _lowerCamelCase	:					Optional[int]   =		None
      if self.use_labels:
         _lowerCamelCase	:					Optional[int]   =		ids_tensor([self.batch_size]      ,   self.type_sequence_label_size)

      _lowerCamelCase	:					Union[str, Any]   =		self.get_config()

      return config, pixel_values, labels





   def 		UpperCamelCase_  (							self)  ->  Optional[int]:
      return ViTConfig(
          image_size=self.image_size      ,   patch_size=self.patch_size      ,   num_channels=self.num_channels      ,   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      ,   is_decoder=SCREAMING_SNAKE_CASE      ,   initializer_range=self.initializer_range      ,   encoder_stride=self.encoder_stride      ,   )





   def 		UpperCamelCase_  (							self      ,   SCREAMING_SNAKE_CASE      ,   SCREAMING_SNAKE_CASE      ,   SCREAMING_SNAKE_CASE)  ->  int:
      _lowerCamelCase	:					Any   =		ViTModel(config=SCREAMING_SNAKE_CASE)
      model.to(SCREAMING_SNAKE_CASE)
      model.eval()
      _lowerCamelCase	:					Any   =		model(SCREAMING_SNAKE_CASE)
      self.parent.assertEqual(result.last_hidden_state.shape      ,   (self.batch_size, self.seq_length, self.hidden_size))





   def 		UpperCamelCase_  (							self      ,   SCREAMING_SNAKE_CASE      ,   SCREAMING_SNAKE_CASE      ,   SCREAMING_SNAKE_CASE)  ->  str:
      _lowerCamelCase	:					List[Any]   =		ViTForMaskedImageModeling(config=SCREAMING_SNAKE_CASE)
      model.to(SCREAMING_SNAKE_CASE)
      model.eval()
      _lowerCamelCase	:					List[str]   =		model(SCREAMING_SNAKE_CASE)
      self.parent.assertEqual(
          result.reconstruction.shape      ,   (self.batch_size, self.num_channels, self.image_size, self.image_size))

      # test greyscale images
      _lowerCamelCase	:					Optional[Any]   =		1
      _lowerCamelCase	:					str   =		ViTForMaskedImageModeling(SCREAMING_SNAKE_CASE)
      model.to(SCREAMING_SNAKE_CASE)
      model.eval()

      _lowerCamelCase	:					Union[str, Any]   =		floats_tensor([self.batch_size, 1, self.image_size, self.image_size])
      _lowerCamelCase	:					int   =		model(SCREAMING_SNAKE_CASE)
      self.parent.assertEqual(result.reconstruction.shape      ,   (self.batch_size, 1, self.image_size, self.image_size))





   def 		UpperCamelCase_  (							self      ,   SCREAMING_SNAKE_CASE      ,   SCREAMING_SNAKE_CASE      ,   SCREAMING_SNAKE_CASE)  ->  List[str]:
      _lowerCamelCase	:					Union[str, Any]   =		self.type_sequence_label_size
      _lowerCamelCase	:					List[str]   =		ViTForImageClassification(SCREAMING_SNAKE_CASE)
      model.to(SCREAMING_SNAKE_CASE)
      model.eval()
      _lowerCamelCase	:					int   =		model(SCREAMING_SNAKE_CASE      ,   labels=SCREAMING_SNAKE_CASE)
      self.parent.assertEqual(result.logits.shape      ,   (self.batch_size, self.type_sequence_label_size))

      # test greyscale images
      _lowerCamelCase	:					int   =		1
      _lowerCamelCase	:					Optional[Any]   =		ViTForImageClassification(SCREAMING_SNAKE_CASE)
      model.to(SCREAMING_SNAKE_CASE)
      model.eval()

      _lowerCamelCase	:					Union[str, Any]   =		floats_tensor([self.batch_size, 1, self.image_size, self.image_size])
      _lowerCamelCase	:					Tuple   =		model(SCREAMING_SNAKE_CASE)
      self.parent.assertEqual(result.logits.shape      ,   (self.batch_size, self.type_sequence_label_size))





   def 		UpperCamelCase_  (							self)  ->  Dict:
      _lowerCamelCase	:					str   =		self.prepare_config_and_inputs()
      (
          (
          _lowerCamelCase
      )   ,    (
          _lowerCamelCase
      )   ,    (
          _lowerCamelCase
      )   ,    
      )	:					Dict   =		config_and_inputs
      _lowerCamelCase	:					int   =		{"""pixel_values""": pixel_values}
      return config, inputs_dict







@require_torch
class 	lowercase__				(					lowercase_ ,lowercase_ ,unittest.TestCase				):
   __UpperCAmelCase							       =					(
       (
           ViTModel,
           ViTForImageClassification,
           ViTForMaskedImageModeling,
       )
       if is_torch_available()
       else ()
   )
   __UpperCAmelCase							       =					(
       {"""feature-extraction""": ViTModel, """image-classification""": ViTForImageClassification}
       if is_torch_available()
       else {}
   )
   __UpperCAmelCase							       =					True

   __UpperCAmelCase							       =					False
   __UpperCAmelCase							       =					False
   __UpperCAmelCase							       =					False





   def 		UpperCamelCase_  (							self)  ->  Dict:
      _lowerCamelCase	:					str   =		ViTModelTester(self)
      _lowerCamelCase	:					Tuple   =		ConfigTester(self      ,   config_class=SCREAMING_SNAKE_CASE      ,   has_text_modality=SCREAMING_SNAKE_CASE      ,   hidden_size=37)





   def 		UpperCamelCase_  (							self)  ->  Any:
      self.config_tester.run_common_tests()





   @unittest.skip(reason="""ViT does not use inputs_embeds""")
   def 		UpperCamelCase_  (							self)  ->  Optional[Any]:
      pass





   def 		UpperCamelCase_  (							self)  ->  List[str]:
      _lowerCamelCase   ,    _lowerCamelCase	:					Any   =		self.model_tester.prepare_config_and_inputs_for_common()

      for model_class in self.all_model_classes:
         _lowerCamelCase	:					Optional[int]   =		model_class(SCREAMING_SNAKE_CASE)
         self.assertIsInstance(model.get_input_embeddings()      ,   (nn.Module))
         _lowerCamelCase	:					Tuple   =		model.get_output_embeddings()
         self.assertTrue(x is None or isinstance(SCREAMING_SNAKE_CASE      ,   nn.Linear))





   def 		UpperCamelCase_  (							self)  ->  Dict:
      _lowerCamelCase   ,    _lowerCamelCase	:					str   =		self.model_tester.prepare_config_and_inputs_for_common()

      for model_class in self.all_model_classes:
         _lowerCamelCase	:					str   =		model_class(SCREAMING_SNAKE_CASE)
         _lowerCamelCase	:					Any   =		inspect.signature(model.forward)
         # signature.parameters is an OrderedDict => so arg_names order is deterministic
         _lowerCamelCase	:					Optional[int]   =		[*signature.parameters.keys()]

         _lowerCamelCase	:					Any   =		["""pixel_values"""]
         self.assertListEqual(arg_names[:1]      ,   SCREAMING_SNAKE_CASE)





   def 		UpperCamelCase_  (							self)  ->  Optional[Any]:
      _lowerCamelCase	:					Optional[int]   =		self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_model(*SCREAMING_SNAKE_CASE)





   def 		UpperCamelCase_  (							self)  ->  int:
      _lowerCamelCase	:					Optional[int]   =		self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_masked_image_modeling(*SCREAMING_SNAKE_CASE)





   def 		UpperCamelCase_  (							self)  ->  Optional[Any]:
      _lowerCamelCase	:					List[str]   =		self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_image_classification(*SCREAMING_SNAKE_CASE)





   @slow
   def 		UpperCamelCase_  (							self)  ->  str:







      for model_name in VIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
         _lowerCamelCase	:					List[str]   =		ViTModel.from_pretrained(SCREAMING_SNAKE_CASE)
         self.assertIsNotNone(SCREAMING_SNAKE_CASE)







def 				_snake_case      (   ):




   """simple docstring"""







   _lowerCamelCase	:					Any   =		Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""   )
   return image





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





   @cached_property
   def 		UpperCamelCase_  (							self)  ->  Optional[int]:
      return ViTImageProcessor.from_pretrained("""google/vit-base-patch16-224""") if is_vision_available() else None





   @slow
   def 		UpperCamelCase_  (							self)  ->  Optional[int]:
      _lowerCamelCase	:					Tuple   =		ViTForImageClassification.from_pretrained("""google/vit-base-patch16-224""").to(SCREAMING_SNAKE_CASE)

      _lowerCamelCase	:					List[str]   =		self.default_image_processor
      _lowerCamelCase	:					List[str]   =		prepare_img()
      _lowerCamelCase	:					str   =		image_processor(images=SCREAMING_SNAKE_CASE      ,   return_tensors="""pt""").to(SCREAMING_SNAKE_CASE)

      # forward pass
      with torch.no_grad():
         _lowerCamelCase	:					int   =		model(**SCREAMING_SNAKE_CASE)

      # verify the logits
      _lowerCamelCase	:					Dict   =		torch.Size((1, 1000))
      self.assertEqual(outputs.logits.shape      ,   SCREAMING_SNAKE_CASE)

      _lowerCamelCase	:					Tuple   =		torch.tensor([-0.27_44, 0.82_15, -0.08_36]).to(SCREAMING_SNAKE_CASE)

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





   @slow
   def 		UpperCamelCase_  (							self)  ->  List[Any]:
      _lowerCamelCase	:					Optional[Any]   =		ViTModel.from_pretrained("""facebook/dino-vits8""").to(SCREAMING_SNAKE_CASE)

      _lowerCamelCase	:					Tuple   =		ViTImageProcessor.from_pretrained("""facebook/dino-vits8"""      ,   size=480)
      _lowerCamelCase	:					int   =		prepare_img()
      _lowerCamelCase	:					Optional[int]   =		image_processor(images=SCREAMING_SNAKE_CASE      ,   return_tensors="""pt""")
      _lowerCamelCase	:					Any   =		inputs.pixel_values.to(SCREAMING_SNAKE_CASE)

      # forward pass
      with torch.no_grad():
         _lowerCamelCase	:					Union[str, Any]   =		model(SCREAMING_SNAKE_CASE      ,   interpolate_pos_encoding=SCREAMING_SNAKE_CASE)

      # verify the logits
      _lowerCamelCase	:					Union[str, Any]   =		torch.Size((1, 3601, 384))
      self.assertEqual(outputs.last_hidden_state.shape      ,   SCREAMING_SNAKE_CASE)

      _lowerCamelCase	:					Union[str, Any]   =		torch.tensor(
          [[4.23_40, 4.39_06, -6.66_92], [4.54_63, 1.89_28, -6.72_57], [4.44_29, 0.84_96, -5.85_85]]).to(SCREAMING_SNAKE_CASE)

      self.assertTrue(torch.allclose(outputs.last_hidden_state[0, :3, :3]      ,   SCREAMING_SNAKE_CASE      ,   atol=1e-4))





   @slow
   @require_accelerate
   @require_torch_gpu
   def 		UpperCamelCase_  (							self)  ->  List[Any]:
      _lowerCamelCase	:					List[str]   =		ViTModel.from_pretrained("""facebook/dino-vits8"""      ,   torch_dtype=torch.floataa      ,   device_map="""auto""")
      _lowerCamelCase	:					Optional[int]   =		self.default_image_processor

      _lowerCamelCase	:					Union[str, Any]   =		prepare_img()
      _lowerCamelCase	:					int   =		image_processor(images=SCREAMING_SNAKE_CASE      ,   return_tensors="""pt""")
      _lowerCamelCase	:					List[Any]   =		inputs.pixel_values.to(SCREAMING_SNAKE_CASE)

      # forward pass to make sure inference works in fp16
      with torch.no_grad():
         _lowerCamelCase	:					str   =		model(SCREAMING_SNAKE_CASE)





'''simple docstring'''

from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional, Union

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig, OnnxSeqaSeqConfigWithPast
from ...utils import logging


if TYPE_CHECKING:
 from ...feature_extraction_utils import FeatureExtractionMixin
 from ...tokenization_utils_base import PreTrainedTokenizerBase
 from ...utils import TensorType

lowerCamelCase				:  Dict    		=      logging.get_logger(__name__)

lowerCamelCase				:  List[Any]    		=      {
    'openai/whisper-base': 'https://huggingface.co/openai/whisper-base/resolve/main/config.json',
}

# fmt: off
lowerCamelCase				:  Dict    		=      [
    1, 2, 7, 8, 9, 10, 14, 25,
    26, 27, 28, 29, 31, 58, 59, 60, 61, 62,
    63, 90, 91, 92, 93, 357, 366, 438, 532, 685,
    705, 796, 930, 1_058, 1_220, 1_267, 1_279, 1_303, 1_343, 1_377,
    1_391, 1_635, 1_782, 1_875, 2_162, 2_361, 2_488, 3_467, 4_008, 4_211,
    4_600, 4_808, 5_299, 5_855, 6_329, 7_203, 9_609, 9_959, 10_563, 10_786,
    11_420, 11_709, 11_907, 13_163, 13_697, 13_700, 14_808, 15_306, 16_410, 16_791,
    17_992, 19_203, 19_510, 20_724, 22_305, 22_935, 27_007, 30_109, 30_420, 33_409,
    34_949, 40_283, 40_493, 40_549, 47_282, 49_146, 50_257, 50_359, 50_360, 50_361
]
lowerCamelCase				:  str    		=      [
    1, 2, 7, 8, 9, 10, 14, 25,
    26, 27, 28, 29, 31, 58, 59, 60, 61, 62,
    63, 90, 91, 92, 93, 359, 503, 522, 542, 873,
    893, 902, 918, 922, 931, 1_350, 1_853, 1_982, 2_460, 2_627,
    3_246, 3_253, 3_268, 3_536, 3_846, 3_961, 4_183, 4_667, 6_585, 6_647,
    7_273, 9_061, 9_383, 10_428, 10_929, 11_938, 12_033, 12_331, 12_562, 13_793,
    14_157, 14_635, 15_265, 15_618, 16_553, 16_604, 18_362, 18_956, 20_075, 21_675,
    22_520, 26_130, 26_161, 26_435, 28_279, 29_464, 31_650, 32_302, 32_470, 36_865,
    42_863, 47_425, 49_870, 50_254, 50_258, 50_360, 50_361, 50_362
]
class     __lowerCAmelCase		(lowercase_	):





      '''simple docstring'''






      lowerCAmelCase__   :	List[str]       =				"""whisper"""
      lowerCAmelCase__   :	Dict       =				["""past_key_values"""]
      lowerCAmelCase__   :	Optional[int]       =				{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}



      def __init__(self       :       int  ,		UpperCamelCase       :       Optional[int]=51865  ,		UpperCamelCase       :       Any=80  ,		UpperCamelCase       :       Dict=6  ,		UpperCamelCase       :       str=4  ,		UpperCamelCase       :       Optional[Any]=6  ,		UpperCamelCase       :       List[Any]=4  ,		UpperCamelCase       :       Tuple=1536  ,		UpperCamelCase       :       Dict=1536  ,		UpperCamelCase       :       Any=0.0  ,		UpperCamelCase       :       Any=0.0  ,		UpperCamelCase       :       int=50257  ,		UpperCamelCase       :       List[str]=True  ,		UpperCamelCase       :       List[Any]=True  ,		UpperCamelCase       :       List[str]="gelu"  ,		UpperCamelCase       :       Dict=256  ,		UpperCamelCase       :       Optional[int]=0.0  ,		UpperCamelCase       :       str=0.0  ,		UpperCamelCase       :       str=0.0  ,		UpperCamelCase       :       Dict=0.02  ,		UpperCamelCase       :       List[Any]=False  ,		UpperCamelCase       :       int=1500  ,		UpperCamelCase       :       List[str]=448  ,		UpperCamelCase       :       int=50256  ,		UpperCamelCase       :       Optional[int]=50256  ,		UpperCamelCase       :       Optional[Any]=50256  ,		UpperCamelCase       :       Any=None  ,		UpperCamelCase       :       Tuple=[220, 50256]  ,		UpperCamelCase       :       Optional[Any]=False  ,		UpperCamelCase       :       int=256  ,		UpperCamelCase       :       Optional[int]=False  ,		UpperCamelCase       :       int=0.05  ,		UpperCamelCase       :       List[Any]=10  ,		UpperCamelCase       :       Optional[int]=2  ,		UpperCamelCase       :       Optional[int]=0.0  ,		UpperCamelCase       :       Dict=10  ,		UpperCamelCase       :       Union[str, Any]=0  ,		UpperCamelCase       :       Union[str, Any]=7  ,		**UpperCamelCase       :       Union[str, Any]  ,		):

             '''simple docstring'''







             lowercase__      =					vocab_size
             lowercase__      =					num_mel_bins
             lowercase__      =					d_model
             lowercase__      =					encoder_layers
             lowercase__      =					encoder_attention_heads
             lowercase__      =					decoder_layers
             lowercase__      =					decoder_attention_heads
             lowercase__      =					decoder_ffn_dim
             lowercase__      =					encoder_ffn_dim
             lowercase__      =					dropout
             lowercase__      =					attention_dropout
             lowercase__      =					activation_dropout
             lowercase__      =					activation_function
             lowercase__      =					init_std
             lowercase__      =					encoder_layerdrop
             lowercase__      =					decoder_layerdrop
             lowercase__      =					use_cache
             lowercase__      =					encoder_layers
             lowercase__      =					scale_embedding  # scale factor will be sqrt(d_model) if True
             lowercase__      =					max_source_positions
             lowercase__      =					max_target_positions

             # Audio Classification-specific parameters. Feel free to ignore for other classes.
             lowercase__      =					classifier_proj_size
             lowercase__      =					use_weighted_layer_sum

             # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
             lowercase__      =					apply_spec_augment
             lowercase__      =					mask_time_prob
             lowercase__      =					mask_time_length
             lowercase__      =					mask_time_min_masks
             lowercase__      =					mask_feature_prob
             lowercase__      =					mask_feature_length
             lowercase__      =					mask_feature_min_masks

             lowercase__      =					median_filter_width

             super().__init__(
                 pad_token_id=UpperCamelCase  ,		bos_token_id=UpperCamelCase  ,		eos_token_id=UpperCamelCase  ,		is_encoder_decoder=UpperCamelCase  ,		decoder_start_token_id=UpperCamelCase  ,		suppress_tokens=UpperCamelCase  ,		begin_suppress_tokens=UpperCamelCase  ,		**UpperCamelCase  ,		)






class     __lowerCAmelCase		(lowercase_	):





      '''simple docstring'''






      @property
      def  UpperCamelCase__						(self       :       str					):

             '''simple docstring'''







             lowercase__      =					OrderedDict(
                 [
                     ('''input_features''', {0: '''batch''', 1: '''feature_size''', 2: '''encoder_sequence'''}),
                 ]					)
             if self.use_past:
                    lowercase__      =					{0: '''batch'''}
             else:
                    lowercase__      =					{0: '''batch''', 1: '''decoder_sequence'''}

             if self.use_past:
                    self.fill_with_past_key_values_(UpperCamelCase  ,		direction='''inputs'''					)

             return common_inputs



      def  UpperCamelCase__						(self       :       Union[str, Any]  ,		UpperCamelCase       :       Union["PreTrainedTokenizerBase", "FeatureExtractionMixin"]  ,		UpperCamelCase       :       int = -1  ,		UpperCamelCase       :       int = -1  ,		UpperCamelCase       :       bool = False  ,		UpperCamelCase       :       Optional["TensorType"] = None  ,		UpperCamelCase       :       int = 22050  ,		UpperCamelCase       :       float = 5.0  ,		UpperCamelCase       :       int = 220  ,		):

             '''simple docstring'''







             lowercase__      =					OrderedDict()
             lowercase__      =					OnnxConfig.generate_dummy_inputs(
                 self  ,		preprocessor=preprocessor.feature_extractor  ,		batch_size=UpperCamelCase  ,		framework=UpperCamelCase  ,		sampling_rate=UpperCamelCase  ,		time_duration=UpperCamelCase  ,		frequency=UpperCamelCase  ,		)
             lowercase__      =					encoder_inputs['''input_features'''].shape[2]
             lowercase__      =					encoder_sequence_length // 2 if self.use_past else seq_length

             lowercase__      =					super().generate_dummy_inputs(
                 preprocessor.tokenizer  ,		UpperCamelCase  ,		UpperCamelCase  ,		UpperCamelCase  ,		UpperCamelCase					)

             lowercase__      =					encoder_inputs.pop('''input_features'''					)
             lowercase__      =					decoder_inputs.pop('''decoder_input_ids'''					)

             if "past_key_values" in decoder_inputs:
                    lowercase__      =					decoder_inputs.pop('''past_key_values'''					)

             return dummy_inputs






      @property
      def  UpperCamelCase__						(self       :       Union[str, Any]					):

             '''simple docstring'''







             return 1E-3




