


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

__UpperCAmelCase : Union[str, Any] 			=				logging.get_logger(__name__)

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

# fmt: off
__UpperCAmelCase : List[Any] 			=				[
    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, 1058, 1220, 1267, 1279, 1303, 1343, 1377,
    1391, 1635, 1782, 1875, 2162, 2361, 2488, 3467, 4008, 4211,
    4600, 4808, 5299, 5855, 6329, 7203, 9609, 9959, 10563, 10786,
    11420, 11709, 11907, 13163, 13697, 13700, 14808, 15306, 16410, 16791,
    17992, 19203, 19510, 20724, 22305, 22935, 27007, 30109, 30420, 33409,
    34949, 40283, 40493, 40549, 47282, 49146, 50257, 50359, 50360, 50361
]
__UpperCAmelCase : Dict 			=				[
    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, 1350, 1853, 1982, 2460, 2627,
    3246, 3253, 3268, 3536, 3846, 3961, 4183, 4667, 6585, 6647,
    7273, 9061, 9383, 10428, 10929, 11938, 12033, 12331, 12562, 13793,
    14157, 14635, 15265, 15618, 16553, 16604, 18362, 18956, 20075, 21675,
    22520, 26130, 26161, 26435, 28279, 29464, 31650, 32302, 32470, 36865,
    42863, 47425, 49870, 50254, 50258, 50360, 50361, 50362
]



class    UpperCAmelCase_	(							_a):
       '''simple docstring'''
       __UpperCamelCase      :     int							=					"whisper"
       __UpperCamelCase      :     Tuple							=					["past_key_values"]
       __UpperCamelCase      :     int							=					{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}






       def __init__(     self ,					__SCREAMING_SNAKE_CASE=51_865 ,					__SCREAMING_SNAKE_CASE=80 ,					__SCREAMING_SNAKE_CASE=6 ,					__SCREAMING_SNAKE_CASE=4 ,					__SCREAMING_SNAKE_CASE=6 ,					__SCREAMING_SNAKE_CASE=4 ,					__SCREAMING_SNAKE_CASE=1_536 ,					__SCREAMING_SNAKE_CASE=1_536 ,					__SCREAMING_SNAKE_CASE=0.0 ,					__SCREAMING_SNAKE_CASE=0.0 ,					__SCREAMING_SNAKE_CASE=50_257 ,					__SCREAMING_SNAKE_CASE=True ,					__SCREAMING_SNAKE_CASE=True ,					__SCREAMING_SNAKE_CASE="gelu" ,					__SCREAMING_SNAKE_CASE=256 ,					__SCREAMING_SNAKE_CASE=0.0 ,					__SCREAMING_SNAKE_CASE=0.0 ,					__SCREAMING_SNAKE_CASE=0.0 ,					__SCREAMING_SNAKE_CASE=0.02 ,					__SCREAMING_SNAKE_CASE=False ,					__SCREAMING_SNAKE_CASE=1_500 ,					__SCREAMING_SNAKE_CASE=448 ,					__SCREAMING_SNAKE_CASE=50_256 ,					__SCREAMING_SNAKE_CASE=50_256 ,					__SCREAMING_SNAKE_CASE=50_256 ,					__SCREAMING_SNAKE_CASE=None ,					__SCREAMING_SNAKE_CASE=[220, 50_256] ,					__SCREAMING_SNAKE_CASE=False ,					__SCREAMING_SNAKE_CASE=256 ,					__SCREAMING_SNAKE_CASE=False ,					__SCREAMING_SNAKE_CASE=0.05 ,					__SCREAMING_SNAKE_CASE=10 ,					__SCREAMING_SNAKE_CASE=2 ,					__SCREAMING_SNAKE_CASE=0.0 ,					__SCREAMING_SNAKE_CASE=10 ,					__SCREAMING_SNAKE_CASE=0 ,					__SCREAMING_SNAKE_CASE=7 ,					**__SCREAMING_SNAKE_CASE ,					):




              """simple docstring"""




              UpperCamelCase    :	Optional[int]   	=		vocab_size
              UpperCamelCase    :	Dict   	=		num_mel_bins
              UpperCamelCase    :	List[Any]   	=		d_model
              UpperCamelCase    :	Optional[Any]   	=		encoder_layers
              UpperCamelCase    :	Optional[int]   	=		encoder_attention_heads
              UpperCamelCase    :	Dict   	=		decoder_layers
              UpperCamelCase    :	List[Any]   	=		decoder_attention_heads
              UpperCamelCase    :	List[Any]   	=		decoder_ffn_dim
              UpperCamelCase    :	str   	=		encoder_ffn_dim
              UpperCamelCase    :	Dict   	=		dropout
              UpperCamelCase    :	Dict   	=		attention_dropout
              UpperCamelCase    :	Optional[int]   	=		activation_dropout
              UpperCamelCase    :	Optional[Any]   	=		activation_function
              UpperCamelCase    :	Tuple   	=		init_std
              UpperCamelCase    :	Tuple   	=		encoder_layerdrop
              UpperCamelCase    :	Optional[int]   	=		decoder_layerdrop
              UpperCamelCase    :	int   	=		use_cache
              UpperCamelCase    :	Union[str, Any]   	=		encoder_layers
              UpperCamelCase    :	Any   	=		scale_embedding  # scale factor will be sqrt(d_model) if True
              UpperCamelCase    :	int   	=		max_source_positions
              UpperCamelCase    :	Union[str, Any]   	=		max_target_positions

              # Audio Classification-specific parameters. Feel free to ignore for other classes.
              UpperCamelCase    :	str   	=		classifier_proj_size
              UpperCamelCase    :	Optional[int]   	=		use_weighted_layer_sum

              # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
              UpperCamelCase    :	List[str]   	=		apply_spec_augment
              UpperCamelCase    :	List[str]   	=		mask_time_prob
              UpperCamelCase    :	Union[str, Any]   	=		mask_time_length
              UpperCamelCase    :	str   	=		mask_time_min_masks
              UpperCamelCase    :	int   	=		mask_feature_prob
              UpperCamelCase    :	Any   	=		mask_feature_length
              UpperCamelCase    :	List[str]   	=		mask_feature_min_masks

              UpperCamelCase    :	Optional[int]   	=		median_filter_width

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




class    UpperCAmelCase_	(							_a):
       '''simple docstring'''






       @property
       def  _lowercase   (     self						):




              """simple docstring"""




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

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

              return common_inputs






       def  _lowercase   (     self ,					__SCREAMING_SNAKE_CASE ,					__SCREAMING_SNAKE_CASE = -1 ,					__SCREAMING_SNAKE_CASE = -1 ,					__SCREAMING_SNAKE_CASE = False ,					__SCREAMING_SNAKE_CASE = None ,					__SCREAMING_SNAKE_CASE = 22_050 ,					__SCREAMING_SNAKE_CASE = 5.0 ,					__SCREAMING_SNAKE_CASE = 220 ,					):




              """simple docstring"""




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

              UpperCamelCase    :	List[Any]   	=		super().generate_dummy_inputs(
                  preprocessor.tokenizer ,					__SCREAMING_SNAKE_CASE ,					__SCREAMING_SNAKE_CASE ,					__SCREAMING_SNAKE_CASE ,					__SCREAMING_SNAKE_CASE						)

              UpperCamelCase    :	List[str]   	=		encoder_inputs.pop('''input_features'''						)
              UpperCamelCase    :	Optional[int]   	=		decoder_inputs.pop('''decoder_input_ids'''						)

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

              return dummy_inputs






       @property
       def  _lowercase   (     self						):




              """simple docstring"""




              return 1e-3





from collections import OrderedDict
from typing import Mapping

from packaging import version

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


__UpperCAmelCase : str 			=				logging.get_logger(__name__)

__UpperCAmelCase : Dict 			=				{
    "hustvl/yolos-small": "https://huggingface.co/hustvl/yolos-small/resolve/main/config.json",
    # See all YOLOS models at https://huggingface.co/models?filter=yolos
}



class    UpperCAmelCase_	(							_a):
       '''simple docstring'''
       __UpperCamelCase      :     Optional[int]							=					"yolos"






       def __init__(     self ,					__SCREAMING_SNAKE_CASE=768 ,					__SCREAMING_SNAKE_CASE=12 ,					__SCREAMING_SNAKE_CASE=12 ,					__SCREAMING_SNAKE_CASE=3_072 ,					__SCREAMING_SNAKE_CASE="gelu" ,					__SCREAMING_SNAKE_CASE=0.0 ,					__SCREAMING_SNAKE_CASE=0.0 ,					__SCREAMING_SNAKE_CASE=0.02 ,					__SCREAMING_SNAKE_CASE=1e-12 ,					__SCREAMING_SNAKE_CASE=[512, 864] ,					__SCREAMING_SNAKE_CASE=16 ,					__SCREAMING_SNAKE_CASE=3 ,					__SCREAMING_SNAKE_CASE=True ,					__SCREAMING_SNAKE_CASE=100 ,					__SCREAMING_SNAKE_CASE=True ,					__SCREAMING_SNAKE_CASE=False ,					__SCREAMING_SNAKE_CASE=1 ,					__SCREAMING_SNAKE_CASE=5 ,					__SCREAMING_SNAKE_CASE=2 ,					__SCREAMING_SNAKE_CASE=5 ,					__SCREAMING_SNAKE_CASE=2 ,					__SCREAMING_SNAKE_CASE=0.1 ,					**__SCREAMING_SNAKE_CASE ,					):




              """simple docstring"""




              super().__init__(**__SCREAMING_SNAKE_CASE						)

              UpperCamelCase    :	Tuple   	=		hidden_size
              UpperCamelCase    :	List[Any]   	=		num_hidden_layers
              UpperCamelCase    :	int   	=		num_attention_heads
              UpperCamelCase    :	Dict   	=		intermediate_size
              UpperCamelCase    :	Dict   	=		hidden_act
              UpperCamelCase    :	int   	=		hidden_dropout_prob
              UpperCamelCase    :	Any   	=		attention_probs_dropout_prob
              UpperCamelCase    :	Optional[Any]   	=		initializer_range
              UpperCamelCase    :	List[Any]   	=		layer_norm_eps
              UpperCamelCase    :	int   	=		image_size
              UpperCamelCase    :	Any   	=		patch_size
              UpperCamelCase    :	str   	=		num_channels
              UpperCamelCase    :	str   	=		qkv_bias
              UpperCamelCase    :	Tuple   	=		num_detection_tokens
              UpperCamelCase    :	List[Any]   	=		use_mid_position_embeddings
              UpperCamelCase    :	Dict   	=		auxiliary_loss
              # Hungarian matcher
              UpperCamelCase    :	Optional[Any]   	=		class_cost
              UpperCamelCase    :	Union[str, Any]   	=		bbox_cost
              UpperCamelCase    :	Any   	=		giou_cost
              # Loss coefficients
              UpperCamelCase    :	List[Any]   	=		bbox_loss_coefficient
              UpperCamelCase    :	Union[str, Any]   	=		giou_loss_coefficient
              UpperCamelCase    :	Dict   	=		eos_coefficient




class    UpperCAmelCase_	(							_a):
       '''simple docstring'''
       __UpperCamelCase      :     List[str]							=					version.parse("1.11")






       @property
       def  _lowercase   (     self						):




              """simple docstring"""




              return OrderedDict(
                  [
                      ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
                  ]						)






       @property
       def  _lowercase   (     self						):




              """simple docstring"""




              return 1e-4






       @property
       def  _lowercase   (     self						):




              """simple docstring"""




              return 12

