


'''simple docstring'''

import functools
import operator

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


lowerCamelCase							:   Dict  						=	logging.get_logger(__name__)

lowerCamelCase							:   List[str]  						=	{
    '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   __lowerCAmelCase						(lowercase_     ):





      '''simple docstring'''






      lowerCAmelCase__					:     Optional[int]  					=							"""unispeech-sat"""



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

             '''simple docstring'''







             super().__init__(**UpperCamelCase   ,						pad_token_id=UpperCamelCase   ,						bos_token_id=UpperCamelCase   ,						eos_token_id=UpperCamelCase )
             lowercase__      			= hidden_size
             lowercase__      			= feat_extract_norm
             lowercase__      			= feat_extract_activation
             lowercase__      			= list(UpperCamelCase )
             lowercase__      			= list(UpperCamelCase )
             lowercase__      			= list(UpperCamelCase )
             lowercase__      			= conv_bias
             lowercase__      			= num_conv_pos_embeddings
             lowercase__      			= num_conv_pos_embedding_groups
             lowercase__      			= len(self.conv_dim )
             lowercase__      			= num_hidden_layers
             lowercase__      			= intermediate_size
             lowercase__      			= hidden_act
             lowercase__      			= num_attention_heads
             lowercase__      			= hidden_dropout
             lowercase__      			= attention_dropout
             lowercase__      			= activation_dropout
             lowercase__      			= feat_proj_dropout
             lowercase__      			= final_dropout
             lowercase__      			= layerdrop
             lowercase__      			= layer_norm_eps
             lowercase__      			= initializer_range
             lowercase__      			= vocab_size
             lowercase__      			= num_clusters
             lowercase__      			= do_stable_layer_norm
             lowercase__      			= 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
             lowercase__      			= apply_spec_augment
             lowercase__      			= mask_time_prob
             lowercase__      			= mask_time_length
             lowercase__      			= mask_time_min_masks
             lowercase__      			= mask_feature_prob
             lowercase__      			= mask_feature_length
             lowercase__      			= mask_feature_min_masks

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

             # ctc loss
             lowercase__      			= ctc_loss_reduction
             lowercase__      			= ctc_zero_infinity

             # SequenceClassification-specific parameter. Feel free to ignore for other classes.
             lowercase__      			= classifier_proj_size

             # XVector-specific parameters. Feel free to ignore for other classes.
             lowercase__      			= list(UpperCamelCase )
             lowercase__      			= list(UpperCamelCase )
             lowercase__      			= list(UpperCamelCase )
             lowercase__      			= xvector_output_dim






      @property
      def       UpperCamelCase__		(self    :    Any ):

             '''simple docstring'''







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








'''simple docstring'''

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


lowerCamelCase							:   Dict  						=	logging.get_logger(__name__)

lowerCamelCase							:   Union[str, Any]  						=	{
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}
class   __lowerCAmelCase						(lowercase_     ):





      '''simple docstring'''






      lowerCAmelCase__					:     List[str]  					=							"""megatron-bert"""



      def __init__(self    :    Tuple   ,						UpperCamelCase    :    Optional[int]=29056   ,						UpperCamelCase    :    Optional[Any]=1024   ,						UpperCamelCase    :    Any=24   ,						UpperCamelCase    :    int=16   ,						UpperCamelCase    :    Optional[int]=4096   ,						UpperCamelCase    :    int="gelu"   ,						UpperCamelCase    :    int=0.1   ,						UpperCamelCase    :    Tuple=0.1   ,						UpperCamelCase    :    Any=512   ,						UpperCamelCase    :    int=2   ,						UpperCamelCase    :    Dict=0.02   ,						UpperCamelCase    :    Dict=1E-12   ,						UpperCamelCase    :    List[Any]=0   ,						UpperCamelCase    :    Optional[int]="absolute"   ,						UpperCamelCase    :    List[Any]=True   ,						**UpperCamelCase    :    str   ,						):

             '''simple docstring'''







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

             lowercase__      			= vocab_size
             lowercase__      			= hidden_size
             lowercase__      			= num_hidden_layers
             lowercase__      			= num_attention_heads
             lowercase__      			= hidden_act
             lowercase__      			= intermediate_size
             lowercase__      			= hidden_dropout_prob
             lowercase__      			= attention_probs_dropout_prob
             lowercase__      			= max_position_embeddings
             lowercase__      			= type_vocab_size
             lowercase__      			= initializer_range
             lowercase__      			= layer_norm_eps
             lowercase__      			= position_embedding_type
             lowercase__      			= use_cache




