

"""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 			__a					(						snake_case_       ):





       """simple docstring"""


       __UpperCamelCase					:      int    =						'''unispeech-sat'''






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





        """simple docstring"""

        super().__init__(**lowercase__			,					pad_token_id=lowercase__			,					bos_token_id=lowercase__			,					eos_token_id=lowercase__   )
        lowerCAmelCase__   :				str 			=				hidden_size
        lowerCAmelCase__   :				int 			=				feat_extract_norm
        lowerCAmelCase__   :				int 			=				feat_extract_activation
        lowerCAmelCase__   :				Dict 			=				list(lowercase__   )
        lowerCAmelCase__   :				Any 			=				list(lowercase__   )
        lowerCAmelCase__   :				Optional[int] 			=				list(lowercase__   )
        lowerCAmelCase__   :				Dict 			=				conv_bias
        lowerCAmelCase__   :				Union[str, Any] 			=				num_conv_pos_embeddings
        lowerCAmelCase__   :				str 			=				num_conv_pos_embedding_groups
        lowerCAmelCase__   :				List[str] 			=				len(self.conv_dim   )
        lowerCAmelCase__   :				List[str] 			=				num_hidden_layers
        lowerCAmelCase__   :				Optional[int] 			=				intermediate_size
        lowerCAmelCase__   :				int 			=				hidden_act
        lowerCAmelCase__   :				Tuple 			=				num_attention_heads
        lowerCAmelCase__   :				str 			=				hidden_dropout
        lowerCAmelCase__   :				List[str] 			=				attention_dropout
        lowerCAmelCase__   :				Union[str, Any] 			=				activation_dropout
        lowerCAmelCase__   :				List[Any] 			=				feat_proj_dropout
        lowerCAmelCase__   :				Union[str, Any] 			=				final_dropout
        lowerCAmelCase__   :				Any 			=				layerdrop
        lowerCAmelCase__   :				Tuple 			=				layer_norm_eps
        lowerCAmelCase__   :				Optional[Any] 			=				initializer_range
        lowerCAmelCase__   :				Any 			=				vocab_size
        lowerCAmelCase__   :				List[str] 			=				num_clusters
        lowerCAmelCase__   :				str 			=				do_stable_layer_norm
        lowerCAmelCase__   :				int 			=				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__   :				Optional[int] 			=				apply_spec_augment
        lowerCAmelCase__   :				int 			=				mask_time_prob
        lowerCAmelCase__   :				Union[str, Any] 			=				mask_time_length
        lowerCAmelCase__   :				Dict 			=				mask_time_min_masks
        lowerCAmelCase__   :				Optional[int] 			=				mask_feature_prob
        lowerCAmelCase__   :				str 			=				mask_feature_length
        lowerCAmelCase__   :				Dict 			=				mask_feature_min_masks

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

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

        # SequenceClassification-specific parameter. Feel free to ignore for other classes.
        lowerCAmelCase__   :				Any 			=				classifier_proj_size

        # XVector-specific parameters. Feel free to ignore for other classes.
        lowerCAmelCase__   :				List[str] 			=				list(lowercase__   )
        lowerCAmelCase__   :				List[Any] 			=				list(lowercase__   )
        lowerCAmelCase__   :				Optional[Any] 			=				list(lowercase__   )
        lowerCAmelCase__   :				List[str] 			=				xvector_output_dim






       @property
       def 			SCREAMING_SNAKE_CASE_	(   self   ):





        """simple docstring"""

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












'''simple docstring'''


from ..utils import DummyObject, requires_backends







class      SCREAMING_SNAKE_CASE    (						metaclass=snake_case_				):
      __magic_name__  :       Dict   							=					['''transformers''', '''torch''', '''note_seq''']






      def __init__( self   :  List[str]						,						*lowercase__   :  Dict						,						**lowercase__   :  int       ):


           '''simple docstring'''

           requires_backends(self						,						["""transformers""", """torch""", """note_seq"""]       )






      @classmethod
      def 							lowercase_						( cls   :  Dict						,						*lowercase__   :  List[str]						,						**lowercase__   :  str       ):


           '''simple docstring'''

           requires_backends(cls						,						["""transformers""", """torch""", """note_seq"""]       )






      @classmethod
      def 							lowercase_						( cls   :  str						,						*lowercase__   :  Optional[int]						,						**lowercase__   :  Any       ):


           '''simple docstring'''

           requires_backends(cls						,						["""transformers""", """torch""", """note_seq"""]       )
