


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


lowerCAmelCase       =							logging.get_logger(__name__)

lowerCAmelCase       =							{
    '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        _a							(			UpperCamelCase__			):
							_lowercase	:			Tuple        = '''speech_to_text'''
							_lowercase	:			List[str]        = ['''past_key_values''']
							_lowercase	:			Tuple        = {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}

							def __init__(							self:	Tuple    ,						UpperCamelCase_:	int=10_000    ,						UpperCamelCase_:	str=12    ,						UpperCamelCase_:	Tuple=2_048    ,						UpperCamelCase_:	Optional[Any]=4    ,						UpperCamelCase_:	str=6    ,						UpperCamelCase_:	Union[str, Any]=2_048    ,						UpperCamelCase_:	List[Any]=4    ,						UpperCamelCase_:	Optional[Any]=0.0    ,						UpperCamelCase_:	Optional[int]=0.0    ,						UpperCamelCase_:	int=True    ,						UpperCamelCase_:	Optional[int]=True    ,						UpperCamelCase_:	Any="relu"    ,						UpperCamelCase_:	Optional[int]=256    ,						UpperCamelCase_:	Any=0.1    ,						UpperCamelCase_:	Any=0.0    ,						UpperCamelCase_:	Dict=0.0    ,						UpperCamelCase_:	Tuple=0.02    ,						UpperCamelCase_:	Any=2    ,						UpperCamelCase_:	Any=True    ,						UpperCamelCase_:	Union[str, Any]=1    ,						UpperCamelCase_:	Optional[int]=0    ,						UpperCamelCase_:	Optional[int]=2    ,						UpperCamelCase_:	Tuple=6_000    ,						UpperCamelCase_:	List[Any]=1_024    ,						UpperCamelCase_:	Any=2    ,						UpperCamelCase_:	Dict=(5, 5)    ,						UpperCamelCase_:	str=1_024    ,						UpperCamelCase_:	str=80    ,						UpperCamelCase_:	Optional[int]=1    ,						**UpperCamelCase_:	Any    ,						)			->   Tuple:





									"""simple docstring"""







									lowercase__            =      vocab_size
									lowercase__            =      d_model
									lowercase__            =      encoder_ffn_dim
									lowercase__            =      encoder_layers
									lowercase__            =      encoder_attention_heads
									lowercase__            =      decoder_ffn_dim
									lowercase__            =      decoder_layers
									lowercase__            =      decoder_attention_heads
									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
									lowercase__            =      num_conv_layers
									lowercase__            =      list(UpperCamelCase_							)
									lowercase__            =      conv_channels
									lowercase__            =      input_feat_per_channel
									lowercase__            =      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=UpperCamelCase_    ,						bos_token_id=UpperCamelCase_    ,						eos_token_id=UpperCamelCase_    ,						is_encoder_decoder=UpperCamelCase_    ,						decoder_start_token_id=UpperCamelCase_    ,						**UpperCamelCase_    ,						)






from ..utils import DummyObject, requires_backends


class        _a							(			metaclass=UpperCamelCase__			):
							_lowercase	:			Any        = ['''torch''', '''scipy''']

							def __init__(							self:	int    ,						*UpperCamelCase_:	Any    ,						**UpperCamelCase_:	Optional[Any]							)			->   List[str]:





									"""simple docstring"""







									requires_backends(self    ,						['''torch''', '''scipy''']							)

							@classmethod
							def       lowerCamelCase_ (							cls:	Optional[int]    ,						*UpperCamelCase_:	Any    ,						**UpperCamelCase_:	List[Any]							)			->   int:





									"""simple docstring"""







									requires_backends(cls    ,						['''torch''', '''scipy''']							)


							@classmethod
							def       lowerCamelCase_ (							cls:	Any    ,						*UpperCamelCase_:	Any    ,						**UpperCamelCase_:	Dict							)			->   Optional[int]:





									"""simple docstring"""







									requires_backends(cls    ,						['''torch''', '''scipy''']							)


