






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


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

a						:			int     	=					{
    "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        a       (					lowercase__  ):



      """simple docstring"""


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

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









'''simple docstring'''






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

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


if TYPE_CHECKING:
      from ... import FeatureExtractionMixin, TensorType

A__							:  Tuple    =logging.get_logger(__name__)

A__							:  Any    ={
    '''openai/imagegpt-small''': '''''',
    '''openai/imagegpt-medium''': '''''',
    '''openai/imagegpt-large''': '''''',
}




class 					UpperCAmelCase	(     snake_case_  ):
      _lowercase:     Tuple			=  '''imagegpt'''
      _lowercase:     Optional[int]			=  ['''past_key_values''']
      _lowercase:     str			=  {
          '''hidden_size''': '''n_embd''',
          '''max_position_embeddings''': '''n_positions''',
          '''num_attention_heads''': '''n_head''',
          '''num_hidden_layers''': '''n_layer''',
      }




      def __init__(     self     :					Optional[int]     ,     __snake_case     :					Optional[Any]=5_12 + 1     ,     __snake_case     :					Union[str, Any]=32 * 32     ,     __snake_case     :					List[Any]=5_12     ,     __snake_case     :					Any=24     ,     __snake_case     :					Optional[Any]=8     ,     __snake_case     :					List[Any]=None     ,     __snake_case     :					str="quick_gelu"     ,     __snake_case     :					List[Any]=0.1     ,     __snake_case     :					str=0.1     ,     __snake_case     :					Optional[int]=0.1     ,     __snake_case     :					Tuple=1E-5     ,     __snake_case     :					Optional[int]=0.02     ,     __snake_case     :					str=True     ,     __snake_case     :					Dict=True     ,     __snake_case     :					Union[str, Any]=False     ,     __snake_case     :					Dict=False     ,     __snake_case     :					Union[str, Any]=False     ,     **__snake_case     :					Union[str, Any]     ,     )							-> List[Any]:
            _lowerCAmelCase					=				vocab_size
            _lowerCAmelCase					=				n_positions
            _lowerCAmelCase					=				n_embd
            _lowerCAmelCase					=				n_layer
            _lowerCAmelCase					=				n_head
            _lowerCAmelCase					=				n_inner
            _lowerCAmelCase					=				activation_function
            _lowerCAmelCase					=				resid_pdrop
            _lowerCAmelCase					=				embd_pdrop
            _lowerCAmelCase					=				attn_pdrop
            _lowerCAmelCase					=				layer_norm_epsilon
            _lowerCAmelCase					=				initializer_range
            _lowerCAmelCase					=				scale_attn_weights
            _lowerCAmelCase					=				use_cache
            _lowerCAmelCase					=				scale_attn_by_inverse_layer_idx
            _lowerCAmelCase					=				reorder_and_upcast_attn
            _lowerCAmelCase					=				tie_word_embeddings

            super().__init__(tie_word_embeddings=__snake_case     ,     **__snake_case    )




class 					UpperCAmelCase	(     snake_case_  ):




      @property
      def 							lowercase__       (     self     :					Optional[Any]    )							-> Mapping[str, Mapping[int, str]]:
            return OrderedDict(
                [
                    ("""input_ids""", {0: """batch""", 1: """sequence"""}),
                ]    )




      def 							lowercase__       (     self     :					Union[str, Any]     ,     __snake_case     :					"FeatureExtractionMixin"     ,     __snake_case     :					int = 1     ,     __snake_case     :					int = -1     ,     __snake_case     :					bool = False     ,     __snake_case     :					Optional["TensorType"] = None     ,     __snake_case     :					int = 3     ,     __snake_case     :					int = 32     ,     __snake_case     :					int = 32     ,     )							-> Mapping[str, Any]:
            _lowerCAmelCase					=				self._generate_dummy_images(__snake_case     ,     __snake_case     ,     __snake_case     ,     __snake_case    )
            _lowerCAmelCase					=				dict(preprocessor(images=__snake_case     ,     return_tensors=__snake_case    )    )

            return inputs






