



'''simple docstring'''





import functools
import operator

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


lowercase_									=    logging.get_logger(__name__)

lowercase_									=    {
    "facebook/wav2vec2-base-960h": "https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json",
    # See all Wav2Vec2 models at https://huggingface.co/models?filter=wav2vec2
}






class __A     (    A		):



 '''simple docstring'''







 __lowerCamelCase       :			str		=			'wav2vec2'



 def __init__(self					,  A=32					,  A=768					,  A=12					,  A=12					,  A=3_072					,  A="gelu"					,  A=0.1					,  A=0.1					,  A=0.1					,  A=0.0					,  A=0.0					,  A=0.1					,  A=0.1					,  A=0.02					,  A=1E-5					,  A="group"					,  A="gelu"					,  A=(512, 512, 512, 512, 512, 512, 512)					,  A=(5, 2, 2, 2, 2, 2, 2)					,  A=(10, 3, 3, 3, 3, 2, 2)					,  A=False					,  A=128					,  A=16					,  A=False					,  A=True					,  A=0.05					,  A=10					,  A=2					,  A=0.0					,  A=10					,  A=0					,  A=320					,  A=2					,  A=0.1					,  A=100					,  A=256					,  A=256					,  A=0.1					,  A="sum"					,  A=False					,  A=False					,  A=256					,  A=(512, 512, 512, 512, 1_500)					,  A=(5, 3, 3, 1, 1)					,  A=(1, 2, 3, 1, 1)					,  A=512					,  A=0					,  A=1					,  A=2					,  A=False					,  A=3					,  A=2					,  A=3					,  A=None					,  A=None					,  **A					,  )       ->	int:


      """simple docstring"""



      super().__init__(**A					,  pad_token_id=A					,  bos_token_id=A					,  eos_token_id=A			)
      _a           =    hidden_size
      _a           =    feat_extract_norm
      _a           =    feat_extract_activation
      _a           =    list(A			)
      _a           =    list(A			)
      _a           =    list(A			)
      _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           =    vocab_size
      _a           =    do_stable_layer_norm
      _a           =    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
      _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

      # adapter
      _a           =    add_adapter
      _a           =    adapter_kernel_size
      _a           =    adapter_stride
      _a           =    num_adapter_layers
      _a           =    output_hidden_size or hidden_size
      _a           =    adapter_attn_dim

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

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



 @property
 def    a__    (self			)       ->	Optional[Any]:


      """simple docstring"""



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








'''simple docstring'''





from __future__ import annotations




def lowerCAmelCase    (__A):



     """simple docstring"""



     return len(set(__A)) == len(__A)


if __name__ == "__main__":
  import doctest

  doctest.testmod()



