





"""simple docstring"""






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 	lowerCAmelCase					(      snake_case							):
       lowerCAmelCase__						 =  """wavlm"""






       def __init__(   self    ,  a__=32    ,  a__=7_68    ,  a__=12    ,  a__=12    ,  a__=30_72    ,  a__="gelu"    ,  a__=0.1    ,  a__=0.1    ,  a__=0.1    ,  a__=0.0    ,  a__=0.1    ,  a__=0.1    ,  a__=0.02    ,  a__=1E-5    ,  a__="group"    ,  a__="gelu"    ,  a__=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)    ,  a__=(5, 2, 2, 2, 2, 2, 2)    ,  a__=(10, 3, 3, 3, 3, 2, 2)    ,  a__=False    ,  a__=1_28    ,  a__=16    ,  a__=3_20    ,  a__=8_00    ,  a__=False    ,  a__=True    ,  a__=0.05    ,  a__=10    ,  a__=2    ,  a__=0.0    ,  a__=10    ,  a__=3_20    ,  a__=2    ,  a__=0.1    ,  a__=1_00    ,  a__=2_56    ,  a__=2_56    ,  a__=0.1    ,  a__="mean"    ,  a__=False    ,  a__=False    ,  a__=2_56    ,  a__=(5_12, 5_12, 5_12, 5_12, 15_00)    ,  a__=(5, 3, 3, 1, 1)    ,  a__=(1, 2, 3, 1, 1)    ,  a__=5_12    ,  a__=80    ,  a__=0    ,  a__=1    ,  a__=2    ,  a__=False    ,  a__=3    ,  a__=2    ,  a__=3    ,  a__=None    ,  **a__    ,  ):
              super().__init__(**a__    ,  pad_token_id=a__    ,  bos_token_id=a__    ,  eos_token_id=a__     )
              _UpperCAmelCase     =     hidden_size
              _UpperCAmelCase     =     feat_extract_norm
              _UpperCAmelCase     =     feat_extract_activation
              _UpperCAmelCase     =     list(a__     )
              _UpperCAmelCase     =     list(a__     )
              _UpperCAmelCase     =     list(a__     )
              _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(a__     )
              _UpperCAmelCase     =     list(a__     )
              _UpperCAmelCase     =     list(a__     )
              _UpperCAmelCase     =     xvector_output_dim






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













"""simple docstring"""






# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase_			=							{'''configuration_timm_backbone''': ['''TimmBackboneConfig''']}


try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCAmelCase_			=							['''TimmBackbone''']


if TYPE_CHECKING:
    from .configuration_timm_backbone import TimmBackboneConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_timm_backbone import TimmBackbone

else:
    import sys

    lowerCAmelCase_			=							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






