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 			UpperCAmelCase__    (		__A					):



     """simple docstring"""






     lowerCAmelCase__		:	int    		= """unispeech-sat"""






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




       '''simple docstring'''




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

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

       # ctc loss
       __UpperCAmelCase						    =       ctc_loss_reduction
       __UpperCAmelCase						    =       ctc_zero_infinity

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

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






     @property
     def 	_UpperCAmelCase				(				self:			Tuple   ) -> str:




       '''simple docstring'''




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




import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union


@dataclass
class 			UpperCAmelCase__    :



  """simple docstring"""






  lowerCAmelCase__		:	Optional[Union[str, Path]]    		= None
  lowerCAmelCase__		:	bool    		= False
  lowerCAmelCase__		:	bool    		= False
  lowerCAmelCase__		:	bool    		= False
  lowerCAmelCase__		:	Optional[Dict]    		= None
  lowerCAmelCase__		:	Optional[str]    		= None
  lowerCAmelCase__		:	bool    		= False
  lowerCAmelCase__		:	bool    		= False
  lowerCAmelCase__		:	bool    		= False
  lowerCAmelCase__		:	bool    		= True
  lowerCAmelCase__		:	Optional[int]    		= None
  lowerCAmelCase__		:	int    		= 1
  lowerCAmelCase__		:	Optional[Union[str, bool]]    		= None
  lowerCAmelCase__		:	bool    		= False
  lowerCAmelCase__		:	Optional[Dict]    		= None
  lowerCAmelCase__		:	Optional[str]    		= None






  def 	_UpperCAmelCase				(				self:			Any   ) -> "DownloadConfig":




    '''simple docstring'''




    return self.__class__(**{k: copy.deepcopy(__lowerCAmelCase   ) for k, v in self.__dict__.items()}   )



