





import functools
import operator

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


UpperCamelCase__           =			logging.get_logger(__name__)

UpperCamelCase__           =			{
    "microsoft/unispeech-large-1500h-cv": (
        "https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json"
    ),
    # See all UniSpeech models at https://huggingface.co/models?filter=unispeech
}

class 							__SCREAMING_SNAKE_CASE       (  __a							):
							snake_case  :   Tuple      =							"""unispeech"""






							def __init__(    self	,			__lowerCAmelCase=32	,			__lowerCAmelCase=768	,			__lowerCAmelCase=12	,			__lowerCAmelCase=12	,			__lowerCAmelCase=3072	,			__lowerCAmelCase="gelu"	,			__lowerCAmelCase=0.1	,			__lowerCAmelCase=0.1	,			__lowerCAmelCase=0.1	,			__lowerCAmelCase=0.0	,			__lowerCAmelCase=0.0	,			__lowerCAmelCase=0.1	,			__lowerCAmelCase=0.1	,			__lowerCAmelCase=0.02	,			__lowerCAmelCase=1E-5	,			__lowerCAmelCase="group"	,			__lowerCAmelCase="gelu"	,			__lowerCAmelCase=(512, 512, 512, 512, 512, 512, 512)	,			__lowerCAmelCase=(5, 2, 2, 2, 2, 2, 2)	,			__lowerCAmelCase=(10, 3, 3, 3, 3, 2, 2)	,			__lowerCAmelCase=False	,			__lowerCAmelCase=128	,			__lowerCAmelCase=16	,			__lowerCAmelCase=False	,			__lowerCAmelCase=True	,			__lowerCAmelCase=0.05	,			__lowerCAmelCase=10	,			__lowerCAmelCase=2	,			__lowerCAmelCase=0.0	,			__lowerCAmelCase=10	,			__lowerCAmelCase=0	,			__lowerCAmelCase=320	,			__lowerCAmelCase=2	,			__lowerCAmelCase=0.1	,			__lowerCAmelCase=100	,			__lowerCAmelCase=256	,			__lowerCAmelCase=256	,			__lowerCAmelCase=0.1	,			__lowerCAmelCase="mean"	,			__lowerCAmelCase=False	,			__lowerCAmelCase=False	,			__lowerCAmelCase=256	,			__lowerCAmelCase=80	,			__lowerCAmelCase=0	,			__lowerCAmelCase=1	,			__lowerCAmelCase=2	,			__lowerCAmelCase=0.5	,			**__lowerCAmelCase	,			):
														super().__init__(**lowercase_	,			pad_token_id=lowercase_	,			bos_token_id=lowercase_	,			eos_token_id=lowercase_	)
														UpperCamelCase__					  =      hidden_size
														UpperCamelCase__					  =      feat_extract_norm
														UpperCamelCase__					  =      feat_extract_activation
														UpperCamelCase__					  =      list(lowercase_	)
														UpperCamelCase__					  =      list(lowercase_	)
														UpperCamelCase__					  =      list(lowercase_	)
														UpperCamelCase__					  =      conv_bias
														UpperCamelCase__					  =      num_conv_pos_embeddings
														UpperCamelCase__					  =      num_conv_pos_embedding_groups
														UpperCamelCase__					  =      len(self.conv_dim	)
														UpperCamelCase__					  =      num_hidden_layers
														UpperCamelCase__					  =      intermediate_size
														UpperCamelCase__					  =      hidden_act
														UpperCamelCase__					  =      num_attention_heads
														UpperCamelCase__					  =      hidden_dropout
														UpperCamelCase__					  =      attention_dropout
														UpperCamelCase__					  =      activation_dropout
														UpperCamelCase__					  =      feat_proj_dropout
														UpperCamelCase__					  =      final_dropout
														UpperCamelCase__					  =      layerdrop
														UpperCamelCase__					  =      layer_norm_eps
														UpperCamelCase__					  =      initializer_range
														UpperCamelCase__					  =      num_ctc_classes
														UpperCamelCase__					  =      vocab_size
														UpperCamelCase__					  =      do_stable_layer_norm
														UpperCamelCase__					  =      use_weighted_layer_sum
														UpperCamelCase__					  =      classifier_proj_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)`, but is `len(config.conv_dim) ="""
																					    f""" {len(self.conv_dim	)}`, `len(config.conv_stride) = {len(self.conv_stride	)}`,"""
																					    f""" `len(config.conv_kernel) = {len(self.conv_kernel	)}`."""	)

														# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
														UpperCamelCase__					  =      apply_spec_augment
														UpperCamelCase__					  =      mask_time_prob
														UpperCamelCase__					  =      mask_time_length
														UpperCamelCase__					  =      mask_time_min_masks
														UpperCamelCase__					  =      mask_feature_prob
														UpperCamelCase__					  =      mask_feature_length
														UpperCamelCase__					  =      mask_feature_min_masks

														# parameters for pretraining with codevector quantized representations
														UpperCamelCase__					  =      num_codevectors_per_group
														UpperCamelCase__					  =      num_codevector_groups
														UpperCamelCase__					  =      contrastive_logits_temperature
														UpperCamelCase__					  =      feat_quantizer_dropout
														UpperCamelCase__					  =      num_negatives
														UpperCamelCase__					  =      codevector_dim
														UpperCamelCase__					  =      proj_codevector_dim
														UpperCamelCase__					  =      diversity_loss_weight

														# ctc loss
														UpperCamelCase__					  =      ctc_loss_reduction
														UpperCamelCase__					  =      ctc_zero_infinity

														# pretraining loss
														UpperCamelCase__					  =      replace_prob







							@property
							def 					_lowerCamelCase		(    self	):
														return functools.reduce(operator.mul	,			self.conv_stride	,			1	)





'''simple docstring'''


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


__snake_case						  =		logging.get_logger(__name__)

__snake_case						  =		{
    """uw-madison/mra-base-512-4""": """https://huggingface.co/uw-madison/mra-base-512-4/resolve/main/config.json""",
}





class       _a    (		__a      ):


  """simple docstring"""

  A_    							=						'''mra'''




  def __init__(		self      :       Any   ,				lowercase_      :       List[str]=50_265   ,				lowercase_      :       Tuple=768   ,				lowercase_      :       Optional[Any]=12   ,				lowercase_      :       str=12   ,				lowercase_      :       Optional[int]=3_072   ,				lowercase_      :       Union[str, Any]="gelu"   ,				lowercase_      :       str=0.1   ,				lowercase_      :       Tuple=0.1   ,				lowercase_      :       str=512   ,				lowercase_      :       Optional[int]=1   ,				lowercase_      :       Tuple=0.0_2   ,				lowercase_      :       List[Any]=1e-5   ,				lowercase_      :       Optional[Any]="absolute"   ,				lowercase_      :       int=4   ,				lowercase_      :       int="full"   ,				lowercase_      :       Tuple=0   ,				lowercase_      :       str=0   ,				lowercase_      :       List[str]=1   ,				lowercase_      :       Tuple=0   ,				lowercase_      :       Optional[Any]=2   ,				**lowercase_      :       List[str]   ,				):







    '''simple docstring'''


    super().__init__(pad_token_id=lowercase_   ,				bos_token_id=lowercase_   ,				eos_token_id=lowercase_   ,				**lowercase_      )

    lowercase_     =       vocab_size
    lowercase_     =       max_position_embeddings
    lowercase_     =       hidden_size
    lowercase_     =       num_hidden_layers
    lowercase_     =       num_attention_heads
    lowercase_     =       intermediate_size
    lowercase_     =       hidden_act
    lowercase_     =       hidden_dropout_prob
    lowercase_     =       attention_probs_dropout_prob
    lowercase_     =       initializer_range
    lowercase_     =       type_vocab_size
    lowercase_     =       layer_norm_eps
    lowercase_     =       position_embedding_type
    lowercase_     =       block_per_row
    lowercase_     =       approx_mode
    lowercase_     =       initial_prior_first_n_blocks
    lowercase_     =       initial_prior_diagonal_n_blocks

