
import functools
import operator

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


lowerCamelCase_						     =					logging.get_logger(__name__)

lowerCamelCase_						     =					{
    '''microsoft/wavlm-base''': '''https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json''',
    # See all WavLM models at https://huggingface.co/models?filter=wavlm
}




class      __A(    __lowerCamelCase			):

  """simple docstring"""
  SCREAMING_SNAKE_CASE__         =      """wavlm"""







  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.02	,      SCREAMING_SNAKE_CASE_=1E-5	,      SCREAMING_SNAKE_CASE_="group"	,      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_=1_28	,      SCREAMING_SNAKE_CASE_=16	,      SCREAMING_SNAKE_CASE_=3_20	,      SCREAMING_SNAKE_CASE_=8_00	,      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_=3_20	,      SCREAMING_SNAKE_CASE_=2	,      SCREAMING_SNAKE_CASE_=0.1	,      SCREAMING_SNAKE_CASE_=1_00	,      SCREAMING_SNAKE_CASE_=2_56	,      SCREAMING_SNAKE_CASE_=2_56	,      SCREAMING_SNAKE_CASE_=0.1	,      SCREAMING_SNAKE_CASE_="mean"	,      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_=80	,      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_	,      ):
       super().__init__(**SCREAMING_SNAKE_CASE_	,      pad_token_id=SCREAMING_SNAKE_CASE_	,      bos_token_id=SCREAMING_SNAKE_CASE_	,      eos_token_id=SCREAMING_SNAKE_CASE_						)
       UpperCamelCase__				=    hidden_size
       UpperCamelCase__				=    feat_extract_norm
       UpperCamelCase__				=    feat_extract_activation
       UpperCamelCase__				=    list(SCREAMING_SNAKE_CASE_						)
       UpperCamelCase__				=    list(SCREAMING_SNAKE_CASE_						)
       UpperCamelCase__				=    list(SCREAMING_SNAKE_CASE_						)
       UpperCamelCase__				=    conv_bias
       UpperCamelCase__				=    num_buckets
       UpperCamelCase__				=    max_bucket_distance
       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__				=    num_ctc_classes
       UpperCamelCase__				=    vocab_size
       UpperCamelCase__				=    do_stable_layer_norm
       UpperCamelCase__				=    use_weighted_layer_sum
       UpperCamelCase__				=    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
       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

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

       # ctc loss
       UpperCamelCase__				=    ctc_loss_reduction
       UpperCamelCase__				=    ctc_zero_infinity

       # adapter
       UpperCamelCase__				=    add_adapter
       UpperCamelCase__				=    adapter_kernel_size
       UpperCamelCase__				=    adapter_stride
       UpperCamelCase__				=    num_adapter_layers
       UpperCamelCase__				=    output_hidden_size or hidden_size

       # 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(SCREAMING_SNAKE_CASE_						)
       UpperCamelCase__				=    list(SCREAMING_SNAKE_CASE_						)
       UpperCamelCase__				=    list(SCREAMING_SNAKE_CASE_						)
       UpperCamelCase__				=    xvector_output_dim







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







import importlib
import inspect
import os
import re


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_config_docstrings.py
lowerCamelCase_						     =					'''src/transformers'''


# This is to make sure the transformers module imported is the one in the repo.
lowerCamelCase_						     =					importlib.util.spec_from_file_location(
    '''transformers''',
    os.path.join(PATH_TO_TRANSFORMERS, '''__init__.py'''),
    submodule_search_locations=[PATH_TO_TRANSFORMERS],
)
lowerCamelCase_						     =					spec.loader.load_module()

lowerCamelCase_						     =					transformers.models.auto.configuration_auto.CONFIG_MAPPING

# Regex pattern used to find the checkpoint mentioned in the docstring of `config_class`.
# For example, `[bert-base-uncased](https://huggingface.co/bert-base-uncased)`
lowerCamelCase_						     =					re.compile('''\[(.+?)\]\((https://huggingface\.co/.+?)\)''')


lowerCamelCase_						     =					{
    '''CLIPConfigMixin''',
    '''DecisionTransformerConfigMixin''',
    '''EncoderDecoderConfigMixin''',
    '''RagConfigMixin''',
    '''SpeechEncoderDecoderConfigMixin''',
    '''VisionEncoderDecoderConfigMixin''',
    '''VisionTextDualEncoderConfigMixin''',
}






def 						__magic_name__			(   ):



     '''simple docstring'''




     UpperCamelCase__				=    []

     for config_class in list(CONFIG_MAPPING.values()						):
          UpperCamelCase__				=    False

          # source code of `config_class`
          UpperCamelCase__				=    inspect.getsource(__a						)
          UpperCamelCase__				=    _re_checkpoint.findall(__a						)

          for checkpoint in checkpoints:
               # Each `checkpoint` is a tuple of a checkpoint name and a checkpoint link.
               # For example, `('bert-base-uncased', 'https://huggingface.co/bert-base-uncased')`
               UpperCamelCase__		,	UpperCamelCase__				=    checkpoint

               # verify the checkpoint name corresponds to the checkpoint link
               UpperCamelCase__				=    f"https://huggingface.co/{ckpt_name}"
               if ckpt_link == ckpt_link_from_name:
                    UpperCamelCase__				=    True
                    break

          UpperCamelCase__				=    config_class.__name__
          if not checkpoint_found and name not in CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK:
               configs_without_checkpoint.append(__a						)

     if len(__a						) > 0:
          UpperCamelCase__				=    """\n""".join(sorted(__a						)						)
          raise ValueError(f"The following configurations don't contain any valid checkpoint:\n{message}"						)


if __name__ == "__main__":
    check_config_docstrings_have_checkpoints()





