

"""simple docstring"""




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


A_				:      Optional[int]           =			logging.get_logger(__name__)

A_				:      Any           =			{
    "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  lowerCamelCase    (A__      ):
			lowerCamelCase__ :		List[Any]       		=				'speech_to_text'
			lowerCamelCase__ :		Optional[Any]       		=				['past_key_values']
			lowerCamelCase__ :		int       		=				{'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}

			def __init__(       self					:    List[Any]     ,					__UpperCAmelCase					:    Union[str, Any]=1_0_0_0_0     ,					__UpperCAmelCase					:    List[Any]=1_2     ,					__UpperCAmelCase					:    List[Any]=2_0_4_8     ,					__UpperCAmelCase					:    Optional[int]=4     ,					__UpperCAmelCase					:    Dict=6     ,					__UpperCAmelCase					:    Any=2_0_4_8     ,					__UpperCAmelCase					:    Union[str, Any]=4     ,					__UpperCAmelCase					:    Dict=0.0     ,					__UpperCAmelCase					:    str=0.0     ,					__UpperCAmelCase					:    Optional[Any]=True     ,					__UpperCAmelCase					:    Any=True     ,					__UpperCAmelCase					:    Union[str, Any]="relu"     ,					__UpperCAmelCase					:    str=2_5_6     ,					__UpperCAmelCase					:    Any=0.1     ,					__UpperCAmelCase					:    Tuple=0.0     ,					__UpperCAmelCase					:    Dict=0.0     ,					__UpperCAmelCase					:    int=0.02     ,					__UpperCAmelCase					:    Dict=2     ,					__UpperCAmelCase					:    Dict=True     ,					__UpperCAmelCase					:    Any=1     ,					__UpperCAmelCase					:    Dict=0     ,					__UpperCAmelCase					:    List[Any]=2     ,					__UpperCAmelCase					:    List[Any]=6_0_0_0     ,					__UpperCAmelCase					:    List[str]=1_0_2_4     ,					__UpperCAmelCase					:    List[Any]=2     ,					__UpperCAmelCase					:    Optional[int]=(5, 5)     ,					__UpperCAmelCase					:    List[str]=1_0_2_4     ,					__UpperCAmelCase					:    List[str]=8_0     ,					__UpperCAmelCase					:    Optional[int]=1     ,					**__UpperCAmelCase					:    Optional[Any]     ,					) ->     Dict:
						SCREAMING_SNAKE_CASE__										=   vocab_size
						SCREAMING_SNAKE_CASE__										=   d_model
						SCREAMING_SNAKE_CASE__										=   encoder_ffn_dim
						SCREAMING_SNAKE_CASE__										=   encoder_layers
						SCREAMING_SNAKE_CASE__										=   encoder_attention_heads
						SCREAMING_SNAKE_CASE__										=   decoder_ffn_dim
						SCREAMING_SNAKE_CASE__										=   decoder_layers
						SCREAMING_SNAKE_CASE__										=   decoder_attention_heads
						SCREAMING_SNAKE_CASE__										=   dropout
						SCREAMING_SNAKE_CASE__										=   attention_dropout
						SCREAMING_SNAKE_CASE__										=   activation_dropout
						SCREAMING_SNAKE_CASE__										=   activation_function
						SCREAMING_SNAKE_CASE__										=   init_std
						SCREAMING_SNAKE_CASE__										=   encoder_layerdrop
						SCREAMING_SNAKE_CASE__										=   decoder_layerdrop
						SCREAMING_SNAKE_CASE__										=   use_cache
						SCREAMING_SNAKE_CASE__										=   encoder_layers
						SCREAMING_SNAKE_CASE__										=   scale_embedding  # scale factor will be sqrt(d_model) if True
						SCREAMING_SNAKE_CASE__										=   max_source_positions
						SCREAMING_SNAKE_CASE__										=   max_target_positions
						SCREAMING_SNAKE_CASE__										=   num_conv_layers
						SCREAMING_SNAKE_CASE__										=   list(__UpperCAmelCase							)
						SCREAMING_SNAKE_CASE__										=   conv_channels
						SCREAMING_SNAKE_CASE__										=   input_feat_per_channel
						SCREAMING_SNAKE_CASE__										=   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     ,					)





"""simple docstring"""




from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


A_				:      Union[str, Any]           =			{
    "susnato/ernie-m-base_pytorch": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json",
    "susnato/ernie-m-large_pytorch": "https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json",
}





class  lowerCamelCase    (A__      ):
			lowerCamelCase__ :		int       		=				'ernie_m'
			lowerCamelCase__ :		Dict[str, str]       		=				{"dropout": "classifier_dropout", "num_classes": "num_labels"}

			def __init__(       self					:    List[str]     ,					__UpperCAmelCase					:    int = 2_5_0_0_0_2     ,					__UpperCAmelCase					:    int = 7_6_8     ,					__UpperCAmelCase					:    int = 1_2     ,					__UpperCAmelCase					:    int = 1_2     ,					__UpperCAmelCase					:    int = 3_0_7_2     ,					__UpperCAmelCase					:    str = "gelu"     ,					__UpperCAmelCase					:    float = 0.1     ,					__UpperCAmelCase					:    float = 0.1     ,					__UpperCAmelCase					:    int = 5_1_4     ,					__UpperCAmelCase					:    float = 0.02     ,					__UpperCAmelCase					:    int = 1     ,					__UpperCAmelCase					:    float = 1e-05     ,					__UpperCAmelCase					:    Union[str, Any]=None     ,					__UpperCAmelCase					:    List[Any]=False     ,					__UpperCAmelCase					:    Union[str, Any]=0.0     ,					**__UpperCAmelCase					:    Any     ,					) ->     Optional[Any]:
						super().__init__(pad_token_id=__UpperCAmelCase     ,					**__UpperCAmelCase							)
						SCREAMING_SNAKE_CASE__										=   vocab_size
						SCREAMING_SNAKE_CASE__										=   hidden_size
						SCREAMING_SNAKE_CASE__										=   num_hidden_layers
						SCREAMING_SNAKE_CASE__										=   num_attention_heads
						SCREAMING_SNAKE_CASE__										=   intermediate_size
						SCREAMING_SNAKE_CASE__										=   hidden_act
						SCREAMING_SNAKE_CASE__										=   hidden_dropout_prob
						SCREAMING_SNAKE_CASE__										=   attention_probs_dropout_prob
						SCREAMING_SNAKE_CASE__										=   max_position_embeddings
						SCREAMING_SNAKE_CASE__										=   initializer_range
						SCREAMING_SNAKE_CASE__										=   layer_norm_eps
						SCREAMING_SNAKE_CASE__										=   classifier_dropout
						SCREAMING_SNAKE_CASE__										=   is_decoder
						SCREAMING_SNAKE_CASE__										=   act_dropout


