
import math

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


lowerCamelCase__     :		Tuple        = logging.get_logger(__name__)

lowerCamelCase__     :		List[str]        = {
    """facebook/data2vec-base-960h""": """https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json""",
    # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio
}



class    _snake_case (						UpperCAmelCase_				):
 __lowerCAmelCase	:  Optional[int]	   =      'data2vec-audio'


 def __init__(       self       ,	SCREAMING_SNAKE_CASE_=32       ,	SCREAMING_SNAKE_CASE_=7_68       ,	SCREAMING_SNAKE_CASE_=12       ,	SCREAMING_SNAKE_CASE_=12       ,	SCREAMING_SNAKE_CASE_=30_72       ,	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.1       ,	SCREAMING_SNAKE_CASE_=0.1       ,	SCREAMING_SNAKE_CASE_=0.0_2       ,	SCREAMING_SNAKE_CASE_=1E-5       ,	SCREAMING_SNAKE_CASE_="gelu"       ,	SCREAMING_SNAKE_CASE_=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)       ,	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_=16       ,	SCREAMING_SNAKE_CASE_=19       ,	SCREAMING_SNAKE_CASE_=5       ,	SCREAMING_SNAKE_CASE_=0.0_5       ,	SCREAMING_SNAKE_CASE_=10       ,	SCREAMING_SNAKE_CASE_=2       ,	SCREAMING_SNAKE_CASE_=0.0       ,	SCREAMING_SNAKE_CASE_=10       ,	SCREAMING_SNAKE_CASE_=0       ,	SCREAMING_SNAKE_CASE_="sum"       ,	SCREAMING_SNAKE_CASE_=False       ,	SCREAMING_SNAKE_CASE_=False       ,	SCREAMING_SNAKE_CASE_=2_56       ,	SCREAMING_SNAKE_CASE_=(5_12, 5_12, 5_12, 5_12, 15_00)       ,	SCREAMING_SNAKE_CASE_=(5, 3, 3, 1, 1)       ,	SCREAMING_SNAKE_CASE_=(1, 2, 3, 1, 1)       ,	SCREAMING_SNAKE_CASE_=5_12       ,	SCREAMING_SNAKE_CASE_=0       ,	SCREAMING_SNAKE_CASE_=1       ,	SCREAMING_SNAKE_CASE_=2       ,	SCREAMING_SNAKE_CASE_=False       ,	SCREAMING_SNAKE_CASE_=3       ,	SCREAMING_SNAKE_CASE_=2       ,	SCREAMING_SNAKE_CASE_=3       ,	SCREAMING_SNAKE_CASE_=None       ,	**SCREAMING_SNAKE_CASE_       ,	):


   '''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_)
   lowercase__	: Union[str, Any]     		=   hidden_size
   lowercase__	: str     		=   feat_extract_activation
   lowercase__	: str     		=   list(SCREAMING_SNAKE_CASE_)
   lowercase__	: Optional[int]     		=   list(SCREAMING_SNAKE_CASE_)
   lowercase__	: List[str]     		=   list(SCREAMING_SNAKE_CASE_)
   lowercase__	: str     		=   conv_bias
   lowercase__	: Dict     		=   num_conv_pos_embeddings
   lowercase__	: int     		=   num_conv_pos_embedding_groups
   lowercase__	: Optional[int]     		=   conv_pos_kernel_size
   lowercase__	: Optional[Any]     		=   len(self.conv_dim)
   lowercase__	: List[Any]     		=   num_hidden_layers
   lowercase__	: List[str]     		=   intermediate_size
   lowercase__	: Tuple     		=   hidden_act
   lowercase__	: Tuple     		=   num_attention_heads
   lowercase__	: Union[str, Any]     		=   hidden_dropout
   lowercase__	: str     		=   attention_dropout
   lowercase__	: int     		=   activation_dropout
   lowercase__	: Union[str, Any]     		=   feat_proj_dropout
   lowercase__	: Any     		=   final_dropout
   lowercase__	: str     		=   layerdrop
   lowercase__	: Any     		=   layer_norm_eps
   lowercase__	: List[Any]     		=   initializer_range
   lowercase__	: Optional[int]     		=   vocab_size
   lowercase__	: Any     		=   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
   lowercase__	: Any     		=   mask_time_prob
   lowercase__	: int     		=   mask_time_length
   lowercase__	: Union[str, Any]     		=   mask_time_min_masks
   lowercase__	: Optional[int]     		=   mask_feature_prob
   lowercase__	: Optional[int]     		=   mask_feature_length
   lowercase__	: Dict     		=   mask_feature_min_masks

   # ctc loss
   lowercase__	: List[str]     		=   ctc_loss_reduction
   lowercase__	: str     		=   ctc_zero_infinity

   # adapter
   lowercase__	: Union[str, Any]     		=   add_adapter
   lowercase__	: Tuple     		=   adapter_kernel_size
   lowercase__	: str     		=   adapter_stride
   lowercase__	: Any     		=   num_adapter_layers
   lowercase__	: str     		=   output_hidden_size or hidden_size

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

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



 @property
 def   lowercase__  (       self):


   '''simple docstring'''




   return math.prod(self.conv_stride)








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

lowerCamelCase__     :		List[Any]        = [{"""type""": """code""", """content""": INSTALL_CONTENT}]
lowerCamelCase__     :		int        = {
    """{processor_class}""": """FakeProcessorClass""",
    """{model_class}""": """FakeModelClass""",
    """{object_class}""": """FakeObjectClass""",
}






