
'''simple docstring'''




import functools
import operator

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


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

lowercase			:				List[Any]    		=			{
    '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  A				(							__snake_case						):
     __magic_name__						=		'''unispeech'''





     def __init__(							self						,			SCREAMING_SNAKE_CASE=32						,			SCREAMING_SNAKE_CASE=768						,			SCREAMING_SNAKE_CASE=12						,			SCREAMING_SNAKE_CASE=12						,			SCREAMING_SNAKE_CASE=3072						,			SCREAMING_SNAKE_CASE="gelu"						,			SCREAMING_SNAKE_CASE=0.1						,			SCREAMING_SNAKE_CASE=0.1						,			SCREAMING_SNAKE_CASE=0.1						,			SCREAMING_SNAKE_CASE=0.0						,			SCREAMING_SNAKE_CASE=0.0						,			SCREAMING_SNAKE_CASE=0.1						,			SCREAMING_SNAKE_CASE=0.1						,			SCREAMING_SNAKE_CASE=0.02						,			SCREAMING_SNAKE_CASE=1e-5						,			SCREAMING_SNAKE_CASE="group"						,			SCREAMING_SNAKE_CASE="gelu"						,			SCREAMING_SNAKE_CASE=(512, 512, 512, 512, 512, 512, 512)						,			SCREAMING_SNAKE_CASE=(5, 2, 2, 2, 2, 2, 2)						,			SCREAMING_SNAKE_CASE=(10, 3, 3, 3, 3, 2, 2)						,			SCREAMING_SNAKE_CASE=False						,			SCREAMING_SNAKE_CASE=128						,			SCREAMING_SNAKE_CASE=16						,			SCREAMING_SNAKE_CASE=False						,			SCREAMING_SNAKE_CASE=True						,			SCREAMING_SNAKE_CASE=0.05						,			SCREAMING_SNAKE_CASE=10						,			SCREAMING_SNAKE_CASE=2						,			SCREAMING_SNAKE_CASE=0.0						,			SCREAMING_SNAKE_CASE=10						,			SCREAMING_SNAKE_CASE=0						,			SCREAMING_SNAKE_CASE=320						,			SCREAMING_SNAKE_CASE=2						,			SCREAMING_SNAKE_CASE=0.1						,			SCREAMING_SNAKE_CASE=100						,			SCREAMING_SNAKE_CASE=256						,			SCREAMING_SNAKE_CASE=256						,			SCREAMING_SNAKE_CASE=0.1						,			SCREAMING_SNAKE_CASE="mean"						,			SCREAMING_SNAKE_CASE=False						,			SCREAMING_SNAKE_CASE=False						,			SCREAMING_SNAKE_CASE=256						,			SCREAMING_SNAKE_CASE=80						,			SCREAMING_SNAKE_CASE=0						,			SCREAMING_SNAKE_CASE=1						,			SCREAMING_SNAKE_CASE=2						,			SCREAMING_SNAKE_CASE=0.5						,			**SCREAMING_SNAKE_CASE						,			) ->				Any:






         """simple docstring"""






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

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

         # ctc loss
         A       :   List[Any]					=						ctc_loss_reduction
         A       :   int					=						ctc_zero_infinity

         # pretraining loss
         A       :   Union[str, Any]					=						replace_prob





     @property
     def 				__lowerCAmelCase							(							self	) ->				Optional[int]:






         """simple docstring"""






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






import inspect
import warnings
from typing import Any, Dict, Optional, Union

from packaging import version







def 						_snake_case(  *SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__ = None					,	SCREAMING_SNAKE_CASE__=True					,	SCREAMING_SNAKE_CASE__=2				) ->    Optional[Any]:
       from .. import __version__

       lowercase							:     int       	=      take_from
       lowercase							:     Tuple       	=      ()
       if not isinstance(args[0]					,	SCREAMING_SNAKE_CASE__				):
              lowercase							:     Dict       	=      (args,)

       for attribute, version_name, message in args:
              if version.parse(version.parse(SCREAMING_SNAKE_CASE__				).base_version				) >= version.parse(SCREAMING_SNAKE_CASE__				):
                     raise ValueError(
                         f"The deprecation tuple {(attribute, version_name, message)} should be removed since diffusers'"
                         f" version {__version__} is >= {version_name}"				)

              lowercase							:     int       	=      None
              if isinstance(SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__				) and attribute in deprecated_kwargs:
                     values += (deprecated_kwargs.pop(SCREAMING_SNAKE_CASE__				),)
                     lowercase							:     Union[str, Any]       	=      f"The `{attribute}` argument is deprecated and will be removed in version {version_name}."
              elif hasattr(SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__				):
                     values += (getattr(SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__				),)
                     lowercase							:     int       	=      f"The `{attribute}` attribute is deprecated and will be removed in version {version_name}."
              elif deprecated_kwargs is None:
                     lowercase							:     Dict       	=      f"`{attribute}` is deprecated and will be removed in version {version_name}."

              if warning is not None:
                     lowercase							:     Dict       	=      warning + """ """ if standard_warn else """"""
                     warnings.warn(warning + message					,	SCREAMING_SNAKE_CASE__					,	stacklevel=SCREAMING_SNAKE_CASE__				)

       if isinstance(SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__				) and len(SCREAMING_SNAKE_CASE__				) > 0:
              lowercase							:     str       	=      inspect.getouterframes(inspect.currentframe()				)[1]
              lowercase							:     List[str]       	=      call_frame.filename
              lowercase							:     Tuple       	=      call_frame.lineno
              lowercase							:     List[str]       	=      call_frame.function
              lowercase	,			lowercase							:     Optional[Any]       	=      next(iter(deprecated_kwargs.items()				)				)
              raise TypeError(f"{function} in {filename} line {line_number-1} got an unexpected keyword argument `{key}`"				)

       if len(SCREAMING_SNAKE_CASE__				) == 0:
              return
       elif len(SCREAMING_SNAKE_CASE__				) == 1:
              return values[0]
       return values
