



import functools
import operator

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


a_								=       logging.get_logger(__name__)

a_								=       {
    """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  (						lowerCAmelCase__ ):
 lowerCAmelCase__							       =	"""unispeech-sat"""




 def __init__(    self						,					__UpperCAmelCase=32						,					__UpperCAmelCase=768						,					__UpperCAmelCase=12						,					__UpperCAmelCase=12						,					__UpperCAmelCase=3072						,					__UpperCAmelCase="gelu"						,					__UpperCAmelCase=0.1						,					__UpperCAmelCase=0.1						,					__UpperCAmelCase=0.1						,					__UpperCAmelCase=0.0						,					__UpperCAmelCase=0.0						,					__UpperCAmelCase=0.1						,					__UpperCAmelCase=0.1						,					__UpperCAmelCase=0.02						,					__UpperCAmelCase=1E-5						,					__UpperCAmelCase="group"						,					__UpperCAmelCase="gelu"						,					__UpperCAmelCase=(512, 512, 512, 512, 512, 512, 512)						,					__UpperCAmelCase=(5, 2, 2, 2, 2, 2, 2)						,					__UpperCAmelCase=(10, 3, 3, 3, 3, 2, 2)						,					__UpperCAmelCase=False						,					__UpperCAmelCase=128						,					__UpperCAmelCase=16						,					__UpperCAmelCase=False						,					__UpperCAmelCase=True						,					__UpperCAmelCase=0.05						,					__UpperCAmelCase=10						,					__UpperCAmelCase=2						,					__UpperCAmelCase=0.0						,					__UpperCAmelCase=10						,					__UpperCAmelCase=0						,					__UpperCAmelCase=320						,					__UpperCAmelCase=2						,					__UpperCAmelCase=0.1						,					__UpperCAmelCase=100						,					__UpperCAmelCase=256						,					__UpperCAmelCase=256						,					__UpperCAmelCase=0.1						,					__UpperCAmelCase="mean"						,					__UpperCAmelCase=False						,					__UpperCAmelCase=False						,					__UpperCAmelCase=256						,					__UpperCAmelCase=(512, 512, 512, 512, 1500)						,					__UpperCAmelCase=(5, 3, 3, 1, 1)						,					__UpperCAmelCase=(1, 2, 3, 1, 1)						,					__UpperCAmelCase=512						,					__UpperCAmelCase=0						,					__UpperCAmelCase=1						,					__UpperCAmelCase=2						,					__UpperCAmelCase=504						,					**__UpperCAmelCase						,					):



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

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

    # ctc loss
    __lowerCamelCase    				=     ctc_loss_reduction
    __lowerCamelCase    				=     ctc_zero_infinity

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

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




 @property
 def 							lowerCamelCase   (    self					):



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











from __future__ import annotations





def 		a__      (		_UpperCamelCase      :			list[float]				):
   if len(_UpperCamelCase				) < 2:
      raise ValueError('''Monogons and Digons are not polygons in the Euclidean space'''				)
   if any(i <= 0 for i in nums				):
      raise ValueError('''All values must be greater than 0'''				)
   __lowerCamelCase    				=     nums.copy()
   copy_nums.sort()
   return copy_nums[-1] < sum(copy_nums[:-1]				)


if __name__ == "__main__":
  import doctest

  doctest.testmod()






