'''simple docstring'''







import functools
import operator

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


UpperCamelCase_      	=	logging.get_logger(__name__)

UpperCamelCase_      	=	{
    "microsoft/unispeech-sat-base-100h-libri-ft": (
        "https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json"
    ),
    # See all UniSpeechSat models at https://huggingface.co/models?filter=unispeech_sat
}




class _SCREAMING_SNAKE_CASE(							lowercase_					):
						A_			:							Optional[Any]     		= 'unispeech-sat'




						def __init__(    self :       List[str]							,							UpperCamelCase_ :       Any=32							,							UpperCamelCase_ :       Tuple=7_68							,							UpperCamelCase_ :       Any=12							,							UpperCamelCase_ :       Union[str, Any]=12							,							UpperCamelCase_ :       Tuple=30_72							,							UpperCamelCase_ :       Optional[int]="gelu"							,							UpperCamelCase_ :       Tuple=0.1							,							UpperCamelCase_ :       Union[str, Any]=0.1							,							UpperCamelCase_ :       Dict=0.1							,							UpperCamelCase_ :       str=0.0							,							UpperCamelCase_ :       List[str]=0.0							,							UpperCamelCase_ :       Tuple=0.1							,							UpperCamelCase_ :       Union[str, Any]=0.1							,							UpperCamelCase_ :       Union[str, Any]=0.02							,							UpperCamelCase_ :       Tuple=1e-5							,							UpperCamelCase_ :       Union[str, Any]="group"							,							UpperCamelCase_ :       Union[str, Any]="gelu"							,							UpperCamelCase_ :       str=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)							,							UpperCamelCase_ :       Tuple=(5, 2, 2, 2, 2, 2, 2)							,							UpperCamelCase_ :       List[str]=(10, 3, 3, 3, 3, 2, 2)							,							UpperCamelCase_ :       List[str]=False							,							UpperCamelCase_ :       Tuple=1_28							,							UpperCamelCase_ :       Optional[Any]=16							,							UpperCamelCase_ :       Optional[Any]=False							,							UpperCamelCase_ :       List[Any]=True							,							UpperCamelCase_ :       int=0.05							,							UpperCamelCase_ :       int=10							,							UpperCamelCase_ :       Optional[int]=2							,							UpperCamelCase_ :       Optional[int]=0.0							,							UpperCamelCase_ :       List[Any]=10							,							UpperCamelCase_ :       List[str]=0							,							UpperCamelCase_ :       Union[str, Any]=3_20							,							UpperCamelCase_ :       Dict=2							,							UpperCamelCase_ :       Tuple=0.1							,							UpperCamelCase_ :       Union[str, Any]=1_00							,							UpperCamelCase_ :       str=2_56							,							UpperCamelCase_ :       str=2_56							,							UpperCamelCase_ :       Tuple=0.1							,							UpperCamelCase_ :       List[Any]="mean"							,							UpperCamelCase_ :       Union[str, Any]=False							,							UpperCamelCase_ :       Any=False							,							UpperCamelCase_ :       List[str]=2_56							,							UpperCamelCase_ :       Tuple=(5_12, 5_12, 5_12, 5_12, 15_00)							,							UpperCamelCase_ :       Any=(5, 3, 3, 1, 1)							,							UpperCamelCase_ :       Dict=(1, 2, 3, 1, 1)							,							UpperCamelCase_ :       Optional[int]=5_12							,							UpperCamelCase_ :       Union[str, Any]=0							,							UpperCamelCase_ :       List[str]=1							,							UpperCamelCase_ :       Optional[Any]=2							,							UpperCamelCase_ :       Dict=5_04							,							**UpperCamelCase_ :       Any							,							)     ->				List[str]:
													super().__init__(**UpperCamelCase_							,							pad_token_id=UpperCamelCase_							,							bos_token_id=UpperCamelCase_							,							eos_token_id=UpperCamelCase_      )
													SCREAMING_SNAKE_CASE__     :str						    = hidden_size
													SCREAMING_SNAKE_CASE__     :str						    = feat_extract_norm
													SCREAMING_SNAKE_CASE__     :Optional[int]						    = feat_extract_activation
													SCREAMING_SNAKE_CASE__     :Optional[int]						    = list(UpperCamelCase_      )
													SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = list(UpperCamelCase_      )
													SCREAMING_SNAKE_CASE__     :str						    = list(UpperCamelCase_      )
													SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = conv_bias
													SCREAMING_SNAKE_CASE__     :Optional[Any]						    = num_conv_pos_embeddings
													SCREAMING_SNAKE_CASE__     :int						    = num_conv_pos_embedding_groups
													SCREAMING_SNAKE_CASE__     :Optional[int]						    = len(self.conv_dim      )
													SCREAMING_SNAKE_CASE__     :Dict						    = num_hidden_layers
													SCREAMING_SNAKE_CASE__     :List[str]						    = intermediate_size
													SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = hidden_act
													SCREAMING_SNAKE_CASE__     :str						    = num_attention_heads
													SCREAMING_SNAKE_CASE__     :Any						    = hidden_dropout
													SCREAMING_SNAKE_CASE__     :str						    = attention_dropout
													SCREAMING_SNAKE_CASE__     :Optional[Any]						    = activation_dropout
													SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = feat_proj_dropout
													SCREAMING_SNAKE_CASE__     :Optional[int]						    = final_dropout
													SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = layerdrop
													SCREAMING_SNAKE_CASE__     :Optional[int]						    = layer_norm_eps
													SCREAMING_SNAKE_CASE__     :List[str]						    = initializer_range
													SCREAMING_SNAKE_CASE__     :List[Any]						    = vocab_size
													SCREAMING_SNAKE_CASE__     :str						    = num_clusters
													SCREAMING_SNAKE_CASE__     :int						    = do_stable_layer_norm
													SCREAMING_SNAKE_CASE__     :Tuple						    = use_weighted_layer_sum

													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
													SCREAMING_SNAKE_CASE__     :Optional[int]						    = apply_spec_augment
													SCREAMING_SNAKE_CASE__     :Optional[int]						    = mask_time_prob
													SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = mask_time_length
													SCREAMING_SNAKE_CASE__     :Optional[int]						    = mask_time_min_masks
													SCREAMING_SNAKE_CASE__     :str						    = mask_feature_prob
													SCREAMING_SNAKE_CASE__     :List[Any]						    = mask_feature_length
													SCREAMING_SNAKE_CASE__     :str						    = mask_feature_min_masks

													# parameters for pretraining with codevector quantized representations
													SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = num_codevectors_per_group
													SCREAMING_SNAKE_CASE__     :Optional[Any]						    = num_codevector_groups
													SCREAMING_SNAKE_CASE__     :List[Any]						    = contrastive_logits_temperature
													SCREAMING_SNAKE_CASE__     :str						    = feat_quantizer_dropout
													SCREAMING_SNAKE_CASE__     :Any						    = num_negatives
													SCREAMING_SNAKE_CASE__     :str						    = codevector_dim
													SCREAMING_SNAKE_CASE__     :str						    = proj_codevector_dim
													SCREAMING_SNAKE_CASE__     :str						    = diversity_loss_weight

													# ctc loss
													SCREAMING_SNAKE_CASE__     :List[str]						    = ctc_loss_reduction
													SCREAMING_SNAKE_CASE__     :Union[str, Any]						    = ctc_zero_infinity

													# SequenceClassification-specific parameter. Feel free to ignore for other classes.
													SCREAMING_SNAKE_CASE__     :Optional[Any]						    = classifier_proj_size

													# XVector-specific parameters. Feel free to ignore for other classes.
													SCREAMING_SNAKE_CASE__     :Dict						    = list(UpperCamelCase_      )
													SCREAMING_SNAKE_CASE__     :Dict						    = list(UpperCamelCase_      )
													SCREAMING_SNAKE_CASE__     :int						    = list(UpperCamelCase_      )
													SCREAMING_SNAKE_CASE__     :Any						    = xvector_output_dim




						@property
						def      __lowerCamelCase       (    self :       Any      )     ->				str:
													return functools.reduce(operator.mul							,							self.conv_stride							,							1      )














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


__a   :							List[Any]						= logging.get_logger(__name__)

# TODO: upload to AWS
__a   :							Union[str, Any]						= {
    "yjernite/retribert-base-uncased": (
        "https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/config.json"
    ),
}


class    __lowercase   (						lowercase_	):







     '''simple docstring'''
     SCREAMING_SNAKE_CASE     =					"retribert"




     def __init__(					self							:      Any			,						UpperCamelCase_							:      int=30_522			,						UpperCamelCase_							:      Optional[int]=768			,						UpperCamelCase_							:      Union[str, Any]=8			,						UpperCamelCase_							:      Tuple=12			,						UpperCamelCase_							:      List[Any]=3_072			,						UpperCamelCase_							:      Tuple="gelu"			,						UpperCamelCase_							:      str=0.1			,						UpperCamelCase_							:      Dict=0.1			,						UpperCamelCase_							:      List[str]=512			,						UpperCamelCase_							:      Optional[int]=2			,						UpperCamelCase_							:      Tuple=0.02			,						UpperCamelCase_							:      List[str]=1e-12			,						UpperCamelCase_							:      Any=True			,						UpperCamelCase_							:      List[Any]=128			,						UpperCamelCase_							:      Union[str, Any]=0			,						**UpperCamelCase_							:      List[str]			,						):


         """simple docstring"""



         super().__init__(pad_token_id=UpperCamelCase_			,						**UpperCamelCase_					)

         __A       =						vocab_size
         __A       =						hidden_size
         __A       =						num_hidden_layers
         __A       =						num_attention_heads
         __A       =						hidden_act
         __A       =						intermediate_size
         __A       =						hidden_dropout_prob
         __A       =						attention_probs_dropout_prob
         __A       =						max_position_embeddings
         __A       =						type_vocab_size
         __A       =						initializer_range
         __A       =						layer_norm_eps
         __A       =						share_encoders
         __A       =						projection_dim




