



"""simple docstring"""







import functools
import operator

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


A    =			logging.get_logger(__name__)

A    =			{
    '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      UpperCAmelCase__		(      UpperCamelCase     ):
		lowerCAmelCase_       :	Dict 							=     """wavlm"""



		def __init__( self  :    int      ,							snake_case  :    Any=32      ,							snake_case  :    List[str]=768      ,							snake_case  :    int=12      ,							snake_case  :    List[str]=12      ,							snake_case  :    Tuple=3_072      ,							snake_case  :    Union[str, Any]="gelu"      ,							snake_case  :    Union[str, Any]=0.1      ,							snake_case  :    Optional[Any]=0.1      ,							snake_case  :    Tuple=0.1      ,							snake_case  :    Tuple=0.0      ,							snake_case  :    List[str]=0.1      ,							snake_case  :    List[str]=0.1      ,							snake_case  :    Tuple=0.02      ,							snake_case  :    int=1E-5      ,							snake_case  :    Optional[int]="group"      ,							snake_case  :    str="gelu"      ,							snake_case  :    Optional[int]=(512, 512, 512, 512, 512, 512, 512)      ,							snake_case  :    str=(5, 2, 2, 2, 2, 2, 2)      ,							snake_case  :    Any=(10, 3, 3, 3, 3, 2, 2)      ,							snake_case  :    Dict=False      ,							snake_case  :    Tuple=128      ,							snake_case  :    Optional[int]=16      ,							snake_case  :    int=320      ,							snake_case  :    Optional[int]=800      ,							snake_case  :    Optional[Any]=False      ,							snake_case  :    Optional[Any]=True      ,							snake_case  :    Union[str, Any]=0.05      ,							snake_case  :    Any=10      ,							snake_case  :    Optional[int]=2      ,							snake_case  :    List[Any]=0.0      ,							snake_case  :    Optional[int]=10      ,							snake_case  :    str=320      ,							snake_case  :    str=2      ,							snake_case  :    int=0.1      ,							snake_case  :    int=100      ,							snake_case  :    Optional[Any]=256      ,							snake_case  :    Union[str, Any]=256      ,							snake_case  :    Tuple=0.1      ,							snake_case  :    List[str]="mean"      ,							snake_case  :    Union[str, Any]=False      ,							snake_case  :    List[Any]=False      ,							snake_case  :    List[Any]=256      ,							snake_case  :    Tuple=(512, 512, 512, 512, 1_500)      ,							snake_case  :    Optional[int]=(5, 3, 3, 1, 1)      ,							snake_case  :    List[str]=(1, 2, 3, 1, 1)      ,							snake_case  :    Tuple=512      ,							snake_case  :    List[str]=80      ,							snake_case  :    List[Any]=0      ,							snake_case  :    List[Any]=1      ,							snake_case  :    List[Any]=2      ,							snake_case  :    Tuple=False      ,							snake_case  :    Tuple=3      ,							snake_case  :    Union[str, Any]=2      ,							snake_case  :    str=3      ,							snake_case  :    Dict=None      ,							**snake_case  :    Tuple      ,							)			->						List[str]:






									'''simple docstring'''

									super().__init__(**snake_case      ,							pad_token_id=snake_case      ,							bos_token_id=snake_case      ,							eos_token_id=snake_case				)
									A         =					hidden_size
									A         =					feat_extract_norm
									A         =					feat_extract_activation
									A         =					list(snake_case				)
									A         =					list(snake_case				)
									A         =					list(snake_case				)
									A         =					conv_bias
									A         =					num_buckets
									A         =					max_bucket_distance
									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

									# parameters for pretraining with codevector quantized representations
									A         =					num_codevectors_per_group
									A         =					num_codevector_groups
									A         =					contrastive_logits_temperature
									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

									# 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(snake_case				)
									A         =					list(snake_case				)
									A         =					list(snake_case				)
									A         =					xvector_output_dim



		@property
		def 					A_		( self  :    str				)			->						str:






									'''simple docstring'''

									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

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


A    =			{'configuration_mra': ['MRA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MraConfig']}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							A    =			[
							    'MRA_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'MraForMaskedLM',
							    'MraForMultipleChoice',
							    'MraForQuestionAnswering',
							    'MraForSequenceClassification',
							    'MraForTokenClassification',
							    'MraLayer',
							    'MraModel',
							    'MraPreTrainedModel',
							]


if TYPE_CHECKING:
							from .configuration_mra import MRA_PRETRAINED_CONFIG_ARCHIVE_MAP, MraConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_mra import (
														    MRA_PRETRAINED_MODEL_ARCHIVE_LIST,
														    MraForMaskedLM,
														    MraForMultipleChoice,
														    MraForQuestionAnswering,
														    MraForSequenceClassification,
														    MraForTokenClassification,
														    MraLayer,
														    MraModel,
														    MraPreTrainedModel,
														)
else:
							import sys

							A    =			_LazyModule(__name__, globals()['__file__'], _import_structure)



