


import warnings

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


snake_case__			 =						logging.get_logger(__name__)

snake_case__			 =						{
    'RUCAIBox/mvp': 'https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json',
}


class 					lowerCAmelCase_ (       lowerCamelCase__):
						lowerCamelCase_         =     'mvp'
						lowerCamelCase_         =     ['past_key_values']
						lowerCamelCase_         =     {'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}




						def __init__(	self						:   Tuple   ,     __A						:   List[Any]=50267   ,     __A						:   Any=1024   ,     __A						:   List[str]=12   ,     __A						:   Any=4096   ,     __A						:   List[Any]=16   ,     __A						:   Union[str, Any]=12   ,     __A						:   Dict=4096   ,     __A						:   List[Any]=16   ,     __A						:   Dict=0.0   ,     __A						:   Any=0.0   ,     __A						:   str="gelu"   ,     __A						:   List[str]=1024   ,     __A						:   Tuple=0.1   ,     __A						:   int=0.0   ,     __A						:   Union[str, Any]=0.0   ,     __A						:   int=0.02   ,     __A						:   Dict=0.0   ,     __A						:   int=False   ,     __A						:   List[Any]=True   ,     __A						:   Dict=1   ,     __A						:   Optional[int]=0   ,     __A						:   Optional[int]=2   ,     __A						:   str=True   ,     __A						:   List[Any]=2   ,     __A						:   Any=2   ,     __A						:   str=False   ,     __A						:   Optional[Any]=100   ,     __A						:   Dict=800   ,     **__A						:   Union[str, Any]   ,     )      ->Optional[Any]:






									"""simple docstring"""






									a__ :Union[str, Any]						  =    vocab_size
									a__ :Dict						  =    max_position_embeddings
									a__ :Optional[int]						  =    d_model
									a__ :Any						  =    encoder_ffn_dim
									a__ :str						  =    encoder_layers
									a__ :Union[str, Any]						  =    encoder_attention_heads
									a__ :Dict						  =    decoder_ffn_dim
									a__ :Optional[int]						  =    decoder_layers
									a__ :int						  =    decoder_attention_heads
									a__ :str						  =    dropout
									a__ :int						  =    attention_dropout
									a__ :Optional[Any]						  =    activation_dropout
									a__ :Optional[int]						  =    activation_function
									a__ :int						  =    init_std
									a__ :List[Any]						  =    encoder_layerdrop
									a__ :Union[str, Any]						  =    decoder_layerdrop
									a__ :Tuple						  =    classifier_dropout
									a__ :Optional[int]						  =    use_cache
									a__ :List[Any]						  =    encoder_layers
									a__ :List[str]						  =    scale_embedding  # scale factor will be sqrt(d_model) if True
									a__ :Any						  =    use_prompt
									a__ :Optional[Any]						  =    prompt_length
									a__ :int						  =    prompt_mid_dim

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

									if self.forced_bos_token_id is None and kwargs.get("force_bos_token_to_be_generated"   ,     __lowerCamelCase						):
												a__ :Union[str, Any]						  =    self.bos_token_id
												warnings.warn(
												    F'''Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions. '''
												    "The config can simply be saved and uploaded again to be fixed."						)






import functools
import operator

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


snake_case__			 =						logging.get_logger(__name__)

snake_case__			 =						{
    '''asapp/sew-tiny-100k''': '''https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json''',
    # See all SEW models at https://huggingface.co/models?filter=sew
}


class 					lowerCAmelCase_ (       _a):
						lowerCamelCase_         =     'sew'




						def __init__(	self						:   Any   ,     __A						:   str=32   ,     __A						:   Dict=768   ,     __A						:   int=12   ,     __A						:   Dict=12   ,     __A						:   Dict=3072   ,     __A						:   int=2   ,     __A						:   Union[str, Any]="gelu"   ,     __A						:   Union[str, Any]=0.1   ,     __A						:   Optional[Any]=0.1   ,     __A						:   Union[str, Any]=0.1   ,     __A						:   str=0.0   ,     __A						:   Union[str, Any]=0.1   ,     __A						:   Optional[Any]=0.1   ,     __A						:   Tuple=0.02   ,     __A						:   Any=1E-5   ,     __A						:   Optional[Any]="group"   ,     __A						:   str="gelu"   ,     __A						:   Dict=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)   ,     __A						:   Tuple=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)   ,     __A						:   int=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)   ,     __A						:   List[str]=False   ,     __A						:   Tuple=128   ,     __A						:   Tuple=16   ,     __A						:   Optional[int]=True   ,     __A						:   Union[str, Any]=0.05   ,     __A						:   List[str]=10   ,     __A						:   Optional[int]=2   ,     __A						:   List[Any]=0.0   ,     __A						:   Optional[Any]=10   ,     __A						:   Tuple=0   ,     __A						:   Tuple="mean"   ,     __A						:   Any=False   ,     __A						:   str=False   ,     __A						:   Dict=256   ,     __A						:   Union[str, Any]=0   ,     __A						:   Optional[int]=1   ,     __A						:   Optional[Any]=2   ,     **__A						:   Tuple   ,     )      ->Tuple:






									"""simple docstring"""






									super().__init__(**__A   ,     pad_token_id=__A   ,     bos_token_id=__A   ,     eos_token_id=__A						)
									a__ :List[Any]						  =    hidden_size
									a__ :List[Any]						  =    feat_extract_norm
									a__ :List[str]						  =    feat_extract_activation
									a__ :Any						  =    list(__A						)
									a__ :Dict						  =    list(__A						)
									a__ :Optional[int]						  =    list(__A						)
									a__ :Any						  =    conv_bias
									a__ :List[str]						  =    num_conv_pos_embeddings
									a__ :str						  =    num_conv_pos_embedding_groups
									a__ :Optional[int]						  =    len(self.conv_dim						)
									a__ :List[Any]						  =    num_hidden_layers
									a__ :str						  =    intermediate_size
									a__ :Dict						  =    squeeze_factor
									a__ :List[Any]						  =    hidden_act
									a__ :Optional[Any]						  =    num_attention_heads
									a__ :Tuple						  =    hidden_dropout
									a__ :Tuple						  =    attention_dropout
									a__ :List[Any]						  =    activation_dropout
									a__ :str						  =    feat_proj_dropout
									a__ :Any						  =    final_dropout
									a__ :Dict						  =    layerdrop
									a__ :List[str]						  =    layer_norm_eps
									a__ :Tuple						  =    initializer_range
									a__ :Dict						  =    vocab_size

									if (
									    (len(self.conv_stride						) != self.num_feat_extract_layers)
									    or (len(self.conv_kernel						) != self.num_feat_extract_layers)
									    or (len(self.conv_dim						) != self.num_feat_extract_layers)
									):
												raise ValueError(
												    "Configuration for convolutional layers is incorrect."
												    "It is required that `len(config.conv_dim)` == `len(config.conv_stride)` == `len(config.conv_kernel)`,"
												    F'''but is `len(config.conv_dim) = {len(self.conv_dim						)}`, `len(config.conv_stride)'''
												    F'''= {len(self.conv_stride						)}`, `len(config.conv_kernel) = {len(self.conv_kernel						)}`.'''						)

									# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
									a__ :int						  =    apply_spec_augment
									a__ :Optional[Any]						  =    mask_time_prob
									a__ :List[Any]						  =    mask_time_length
									a__ :Any						  =    mask_time_min_masks
									a__ :Any						  =    mask_feature_prob
									a__ :Dict						  =    mask_feature_length
									a__ :Union[str, Any]						  =    mask_feature_min_masks

									# ctc loss
									a__ :Dict						  =    ctc_loss_reduction
									a__ :Any						  =    ctc_zero_infinity

									# sequence classification
									a__ :Optional[int]						  =    use_weighted_layer_sum
									a__ :Tuple						  =    classifier_proj_size






						@property
						def  _snake_case					(	self						:   Dict						)      ->Union[str, Any]:






									"""simple docstring"""






									return functools.reduce(operator.mul   ,     self.conv_stride   ,     1						)


