





'''simple docstring'''




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


_A:					Any							=				logging.get_logger(__name__)

_A:					Dict							=				{
    """facebook/s2t-small-librispeech-asr""": (
        """https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json"""
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text
}






class UpperCAmelCase							(		UpperCAmelCase_							):
    _A :			Union[str, Any]						   =       """speech_to_text"""
    _A :			str						   =       ["""past_key_values"""]
    _A :			List[Any]						   =       {"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}



    def __init__(  self     ,			__A=10_000     ,			__A=12     ,			__A=2_048     ,			__A=4     ,			__A=6     ,			__A=2_048     ,			__A=4     ,			__A=0.0     ,			__A=0.0     ,			__A=True     ,			__A=True     ,			__A="relu"     ,			__A=256     ,			__A=0.1     ,			__A=0.0     ,			__A=0.0     ,			__A=0.0_2     ,			__A=2     ,			__A=True     ,			__A=1     ,			__A=0     ,			__A=2     ,			__A=6_000     ,			__A=1_024     ,			__A=2     ,			__A=(5, 5)     ,			__A=1_024     ,			__A=80     ,			__A=1     ,			**__A     ,			):
     __UpperCAmelCase     :   Dict					=   vocab_size
     __UpperCAmelCase     :   int					=   d_model
     __UpperCAmelCase     :   Optional[int]					=   encoder_ffn_dim
     __UpperCAmelCase     :   Any					=   encoder_layers
     __UpperCAmelCase     :   Optional[int]					=   encoder_attention_heads
     __UpperCAmelCase     :   str					=   decoder_ffn_dim
     __UpperCAmelCase     :   Dict					=   decoder_layers
     __UpperCAmelCase     :   Tuple					=   decoder_attention_heads
     __UpperCAmelCase     :   List[Any]					=   dropout
     __UpperCAmelCase     :   Dict					=   attention_dropout
     __UpperCAmelCase     :   Optional[int]					=   activation_dropout
     __UpperCAmelCase     :   str					=   activation_function
     __UpperCAmelCase     :   Union[str, Any]					=   init_std
     __UpperCAmelCase     :   Any					=   encoder_layerdrop
     __UpperCAmelCase     :   Optional[int]					=   decoder_layerdrop
     __UpperCAmelCase     :   int					=   use_cache
     __UpperCAmelCase     :   int					=   encoder_layers
     __UpperCAmelCase     :   Dict					=   scale_embedding  # scale factor will be sqrt(d_model) if True
     __UpperCAmelCase     :   Tuple					=   max_source_positions
     __UpperCAmelCase     :   str					=   max_target_positions
     __UpperCAmelCase     :   Optional[int]					=   num_conv_layers
     __UpperCAmelCase     :   Any					=   list(__A					)
     __UpperCAmelCase     :   int					=   conv_channels
     __UpperCAmelCase     :   Tuple					=   input_feat_per_channel
     __UpperCAmelCase     :   Optional[int]					=   input_channels

     if len(self.conv_kernel_sizes					) != self.num_conv_layers:
      raise ValueError(
          'Configuration for convolutional module is incorrect. '
          'It is required that `len(config.conv_kernel_sizes)` == `config.num_conv_layers` '
          f'but is `len(config.conv_kernel_sizes) = {len(self.conv_kernel_sizes					)}`, '
          f'`config.num_conv_layers = {self.num_conv_layers}`.'					)

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












'''simple docstring'''




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


_A:					Tuple							=				logging.get_logger(__name__)






class UpperCAmelCase							(		UpperCAmelCase_							):
    _A :			List[Any]						   =       """timm_backbone"""



    def __init__(  self     ,			__A=None     ,			__A=3     ,			__A=True     ,			__A=True     ,			__A=None     ,			**__A     ,			):
     super().__init__(**__A					)
     __UpperCAmelCase					=   backbone
     __UpperCAmelCase					=   num_channels
     __UpperCAmelCase					=   features_only
     __UpperCAmelCase					=   use_pretrained_backbone
     __UpperCAmelCase					=   True
     __UpperCAmelCase					=   out_indices if out_indices is not None else (-1,)





