'''simple docstring'''

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


__a: int          =   logging.get_logger(__name__)

__a: Tuple          =   {
    """facebook/levit-128S""": """https://huggingface.co/facebook/levit-128S/resolve/main/config.json""",
    # See all LeViT models at https://huggingface.co/models?filter=levit
}



class 			UpperCAmelCase  (						a__					):





       '''simple docstring'''



       SCREAMING_SNAKE_CASE							=    "levit"

       def __init__(						self	,   __lowerCAmelCase=224	,   __lowerCAmelCase=3	,   __lowerCAmelCase=3	,   __lowerCAmelCase=2	,   __lowerCAmelCase=1	,   __lowerCAmelCase=16	,   __lowerCAmelCase=[128, 256, 384]	,   __lowerCAmelCase=[4, 8, 12]	,   __lowerCAmelCase=[4, 4, 4]	,   __lowerCAmelCase=[16, 16, 16]	,   __lowerCAmelCase=0	,   __lowerCAmelCase=[2, 2, 2]	,   __lowerCAmelCase=[2, 2, 2]	,   __lowerCAmelCase=0.0_2	,   **__lowerCAmelCase	,   )  ->  Tuple:
        super().__init__(**SCREAMING_SNAKE_CASE_ )
        lowercase__				:    Optional[int]  =					image_size
        lowercase__				:    str  =					num_channels
        lowercase__				:    List[Any]  =					kernel_size
        lowercase__				:    Any  =					stride
        lowercase__				:    List[Any]  =					padding
        lowercase__				:    Optional[int]  =					hidden_sizes
        lowercase__				:    Optional[int]  =					num_attention_heads
        lowercase__				:    List[Any]  =					depths
        lowercase__				:    str  =					key_dim
        lowercase__				:    Tuple  =					drop_path_rate
        lowercase__				:    List[str]  =					patch_size
        lowercase__				:    List[str]  =					attention_ratio
        lowercase__				:    Optional[int]  =					mlp_ratio
        lowercase__				:    Optional[Any]  =					initializer_range
        lowercase__				:    List[str]  =					[
            ['Subsample', key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
            ['Subsample', key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
        ]



class 			UpperCAmelCase  (						a__					):





       '''simple docstring'''



       SCREAMING_SNAKE_CASE							=    version.parse("1.11"					)

       @property
       def _lowerCAmelCase(						self )  ->  Mapping[str, Mapping[int, str]]:
        return OrderedDict(
            [
                ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
            ] )


       @property
       def _lowerCAmelCase(						self )  ->  float:
        return 1E-4






from ...configuration_utils import PretrainedConfig
from ...utils import logging


__UpperCAmelCase          =       logging.get_logger(__name__)

__UpperCAmelCase          =       {
    '''facebook/s2t-wav2vec2-large-en-de''': (
        '''https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json'''
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}



class 				lowerCAmelCase_		(  a__							):
       UpperCAmelCase__				:					Optional[Any]        =  "speech_to_text_2"
       UpperCAmelCase__				:					List[Any]        =  ["past_key_values"]
       UpperCAmelCase__				:					Any        =  {"num_attention_heads": "decoder_attention_heads", "hidden_size": "d_model"}
       def __init__(			self,			SCREAMING_SNAKE_CASE_=1_0000,			SCREAMING_SNAKE_CASE_=6,			SCREAMING_SNAKE_CASE_=2048,			SCREAMING_SNAKE_CASE_=4,			SCREAMING_SNAKE_CASE_=0.0,			SCREAMING_SNAKE_CASE_=True,			SCREAMING_SNAKE_CASE_="relu",			SCREAMING_SNAKE_CASE_=256,			SCREAMING_SNAKE_CASE_=0.1,			SCREAMING_SNAKE_CASE_=0.0,			SCREAMING_SNAKE_CASE_=0.0,			SCREAMING_SNAKE_CASE_=0.02,			SCREAMING_SNAKE_CASE_=2,			SCREAMING_SNAKE_CASE_=True,			SCREAMING_SNAKE_CASE_=1,			SCREAMING_SNAKE_CASE_=0,			SCREAMING_SNAKE_CASE_=2,			SCREAMING_SNAKE_CASE_=1024,			**SCREAMING_SNAKE_CASE_,			)     ->		int:
          UpperCamelCase    :  Optional[int]							=	vocab_size
          UpperCamelCase    :  List[str]							=	d_model
          UpperCamelCase    :  List[str]							=	decoder_ffn_dim
          UpperCamelCase    :  Optional[Any]							=	decoder_layers
          UpperCamelCase    :  Any							=	decoder_attention_heads
          UpperCamelCase    :  Tuple							=	dropout
          UpperCamelCase    :  str							=	attention_dropout
          UpperCamelCase    :  str							=	activation_dropout
          UpperCamelCase    :  Union[str, Any]							=	activation_function
          UpperCamelCase    :  Optional[int]							=	init_std
          UpperCamelCase    :  Tuple							=	decoder_layerdrop
          UpperCamelCase    :  Dict							=	use_cache
          UpperCamelCase    :  Any							=	decoder_layers
          UpperCamelCase    :  Union[str, Any]							=	scale_embedding  # scale factor will be sqrt(d_model) if True
          UpperCamelCase    :  Union[str, Any]							=	max_target_positions

          super().__init__(
              pad_token_id=SCREAMING_SNAKE_CASE_,			bos_token_id=SCREAMING_SNAKE_CASE_,			eos_token_id=SCREAMING_SNAKE_CASE_,			decoder_start_token_id=SCREAMING_SNAKE_CASE_,			**SCREAMING_SNAKE_CASE_,			)



