





'''simple docstring'''

import functools
import operator

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


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

__lowerCAmelCase							:     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        UpperCAmelCase     (	_lowerCAmelCase    ):
 __lowercase       		=    """unispeech"""
 def __init__(    self				:Optional[Any]						,	lowercase_				:Union[str, Any]=32						,	lowercase_				:Any=7_68						,	lowercase_				:Union[str, Any]=12						,	lowercase_				:Optional[int]=12						,	lowercase_				:Optional[Any]=30_72						,	lowercase_				:List[Any]="gelu"						,	lowercase_				:Optional[int]=0.1						,	lowercase_				:str=0.1						,	lowercase_				:List[str]=0.1						,	lowercase_				:List[str]=0.0						,	lowercase_				:Any=0.0						,	lowercase_				:int=0.1						,	lowercase_				:Any=0.1						,	lowercase_				:Union[str, Any]=0.0_2						,	lowercase_				:Tuple=1E-5						,	lowercase_				:Tuple="group"						,	lowercase_				:Tuple="gelu"						,	lowercase_				:Optional[int]=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)						,	lowercase_				:Tuple=(5, 2, 2, 2, 2, 2, 2)						,	lowercase_				:Any=(10, 3, 3, 3, 3, 2, 2)						,	lowercase_				:Dict=False						,	lowercase_				:Optional[int]=1_28						,	lowercase_				:Tuple=16						,	lowercase_				:int=False						,	lowercase_				:Optional[int]=True						,	lowercase_				:Optional[Any]=0.0_5						,	lowercase_				:Any=10						,	lowercase_				:str=2						,	lowercase_				:List[Any]=0.0						,	lowercase_				:Dict=10						,	lowercase_				:int=0						,	lowercase_				:Optional[int]=3_20						,	lowercase_				:int=2						,	lowercase_				:str=0.1						,	lowercase_				:Union[str, Any]=1_00						,	lowercase_				:Any=2_56						,	lowercase_				:Dict=2_56						,	lowercase_				:str=0.1						,	lowercase_				:Union[str, Any]="mean"						,	lowercase_				:Optional[Any]=False						,	lowercase_				:Optional[int]=False						,	lowercase_				:Dict=2_56						,	lowercase_				:int=80						,	lowercase_				:List[str]=0						,	lowercase_				:Optional[Any]=1						,	lowercase_				:Dict=2						,	lowercase_				:str=0.5						,	**lowercase_				:List[Any]						,	)->							Optional[int]:
     super().__init__(**SCREAMING_SNAKE_CASE_						,	pad_token_id=SCREAMING_SNAKE_CASE_						,	bos_token_id=SCREAMING_SNAKE_CASE_						,	eos_token_id=SCREAMING_SNAKE_CASE_							)
     A__    =      hidden_size
     A__    =      feat_extract_norm
     A__    =      feat_extract_activation
     A__    =      list(SCREAMING_SNAKE_CASE_							)
     A__    =      list(SCREAMING_SNAKE_CASE_							)
     A__    =      list(SCREAMING_SNAKE_CASE_							)
     A__    =      conv_bias
     A__    =      num_conv_pos_embeddings
     A__    =      num_conv_pos_embedding_groups
     A__    =      len(self.conv_dim							)
     A__    =      num_hidden_layers
     A__    =      intermediate_size
     A__    =      hidden_act
     A__    =      num_attention_heads
     A__    =      hidden_dropout
     A__    =      attention_dropout
     A__    =      activation_dropout
     A__    =      feat_proj_dropout
     A__    =      final_dropout
     A__    =      layerdrop
     A__    =      layer_norm_eps
     A__    =      initializer_range
     A__    =      num_ctc_classes
     A__    =      vocab_size
     A__    =      do_stable_layer_norm
     A__    =      use_weighted_layer_sum
     A__    =      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__    =      apply_spec_augment
     A__    =      mask_time_prob
     A__    =      mask_time_length
     A__    =      mask_time_min_masks
     A__    =      mask_feature_prob
     A__    =      mask_feature_length
     A__    =      mask_feature_min_masks

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

     # ctc loss
     A__    =      ctc_loss_reduction
     A__    =      ctc_zero_infinity

     # pretraining loss
     A__    =      replace_prob



 @property
 def 					UpperCAmelCase_							(    self				:Dict							)->							Dict:
     return functools.reduce(operator.mul						,	self.conv_stride						,	1							)










'''simple docstring'''

__lowerCAmelCase							:     Dict		     ="\n# Installazione di Transformers\n! pip install transformers datasets\n# Per installare dalla fonte invece dell'ultima versione rilasciata, commenta il comando sopra e\n# rimuovi la modalità commento al comando seguente.\n# ! pip install git+https://github.com/huggingface/transformers.git\n"

__lowerCAmelCase							:     Optional[Any]		     =[{"type": "code", "content": INSTALL_CONTENT}]
__lowerCAmelCase							:     Tuple		     ={
    "{processor_class}": "FakeProcessorClass",
    "{model_class}": "FakeModelClass",
    "{object_class}": "FakeObjectClass",
}



