






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


lowerCamelCase : Optional[Any]						   =       logging.get_logger(__name__)

lowerCamelCase : Dict						   =       {
    '''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			):

					'''simple docstring'''

					_A						:			Optional[Any]									=      '''speech_to_text_2'''
					_A						:			Optional[Any]									=      ['''past_key_values''']
					_A						:			Tuple									=      {'''num_attention_heads''': '''decoder_attention_heads''', '''hidden_size''': '''d_model'''}



					def __init__(  self				:	Optional[Any]		,     __a				:	str=10000		,     __a				:	str=6		,     __a				:	Optional[int]=2048		,     __a				:	Dict=4		,     __a				:	str=0.0		,     __a				:	Optional[Any]=True		,     __a				:	str="relu"		,     __a				:	Dict=256		,     __a				:	str=0.1		,     __a				:	Tuple=0.0		,     __a				:	Any=0.0		,     __a				:	Optional[int]=0.02		,     __a				:	Any=2		,     __a				:	Dict=True		,     __a				:	Optional[int]=1		,     __a				:	Dict=0		,     __a				:	List[Any]=2		,     __a				:	str=1024		,     **__a				:	Tuple		,     )			->  Dict:


												"""simple docstring"""

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

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













from torch import nn

class 		lowerCAmelCase     ( nn.Module			):

					'''simple docstring'''

					def __init__(  self				:	Tuple		,     __a				:	int		,     __a				:	Optional[int]							)			->  Union[str, Any]:


												"""simple docstring"""

												super().__init__()
												__lowercase      :							int				=     class_size
												__lowercase      :							int				=     embed_size
												# self.mlp1 = nn.Linear(embed_size, embed_size)
												# self.mlp2 = (nn.Linear(embed_size, class_size))
												__lowercase      :							str				=     nn.Linear(__a		,     __a							)



					def       lowerCAmelCase				(  self				:	Tuple		,     __a				:	int							)			->  Tuple:


												"""simple docstring"""

												__lowercase      :							str				=     self.mlp(__a							)
												return logits