
import functools
import operator

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


lowerCAmelCase__:    Dict      = logging.get_logger(__name__)

lowerCAmelCase__:    Dict      = {
    "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 							snake_case_ (				A__    ):
			__lowerCamelCase							:     Union[str, Any]						=			"""wavlm"""





			def __init__(		self      ,						__lowerCAmelCase=32      ,						__lowerCAmelCase=768      ,						__lowerCAmelCase=12      ,						__lowerCAmelCase=12      ,						__lowerCAmelCase=3_072      ,						__lowerCAmelCase="gelu"      ,						__lowerCAmelCase=0.1      ,						__lowerCAmelCase=0.1      ,						__lowerCAmelCase=0.1      ,						__lowerCAmelCase=0.0      ,						__lowerCAmelCase=0.1      ,						__lowerCAmelCase=0.1      ,						__lowerCAmelCase=0.02      ,						__lowerCAmelCase=1e-5      ,						__lowerCAmelCase="group"      ,						__lowerCAmelCase="gelu"      ,						__lowerCAmelCase=(512, 512, 512, 512, 512, 512, 512)      ,						__lowerCAmelCase=(5, 2, 2, 2, 2, 2, 2)      ,						__lowerCAmelCase=(10, 3, 3, 3, 3, 2, 2)      ,						__lowerCAmelCase=False      ,						__lowerCAmelCase=128      ,						__lowerCAmelCase=16      ,						__lowerCAmelCase=320      ,						__lowerCAmelCase=800      ,						__lowerCAmelCase=False      ,						__lowerCAmelCase=True      ,						__lowerCAmelCase=0.05      ,						__lowerCAmelCase=10      ,						__lowerCAmelCase=2      ,						__lowerCAmelCase=0.0      ,						__lowerCAmelCase=10      ,						__lowerCAmelCase=320      ,						__lowerCAmelCase=2      ,						__lowerCAmelCase=0.1      ,						__lowerCAmelCase=100      ,						__lowerCAmelCase=256      ,						__lowerCAmelCase=256      ,						__lowerCAmelCase=0.1      ,						__lowerCAmelCase="mean"      ,						__lowerCAmelCase=False      ,						__lowerCAmelCase=False      ,						__lowerCAmelCase=256      ,						__lowerCAmelCase=(512, 512, 512, 512, 1_500)      ,						__lowerCAmelCase=(5, 3, 3, 1, 1)      ,						__lowerCAmelCase=(1, 2, 3, 1, 1)      ,						__lowerCAmelCase=512      ,						__lowerCAmelCase=80      ,						__lowerCAmelCase=0      ,						__lowerCAmelCase=1      ,						__lowerCAmelCase=2      ,						__lowerCAmelCase=False      ,						__lowerCAmelCase=3      ,						__lowerCAmelCase=2      ,						__lowerCAmelCase=3      ,						__lowerCAmelCase=None      ,						**__lowerCAmelCase      ,						):
					super().__init__(**_UpperCamelCase      ,						pad_token_id=_UpperCamelCase      ,						bos_token_id=_UpperCamelCase      ,						eos_token_id=_UpperCamelCase      )
					SCREAMING_SNAKE_CASE_					:	List[str]		  =			hidden_size
					SCREAMING_SNAKE_CASE_					:	Dict		  =			feat_extract_norm
					SCREAMING_SNAKE_CASE_					:	List[str]		  =			feat_extract_activation
					SCREAMING_SNAKE_CASE_					:	Optional[int]		  =			list(_UpperCamelCase      )
					SCREAMING_SNAKE_CASE_					:	Optional[Any]		  =			list(_UpperCamelCase      )
					SCREAMING_SNAKE_CASE_					:	Optional[int]		  =			list(_UpperCamelCase      )
					SCREAMING_SNAKE_CASE_					:	Tuple		  =			conv_bias
					SCREAMING_SNAKE_CASE_					:	Dict		  =			num_buckets
					SCREAMING_SNAKE_CASE_					:	Any		  =			max_bucket_distance
					SCREAMING_SNAKE_CASE_					:	Union[str, Any]		  =			num_conv_pos_embeddings
					SCREAMING_SNAKE_CASE_					:	Tuple		  =			num_conv_pos_embedding_groups
					SCREAMING_SNAKE_CASE_					:	Union[str, Any]		  =			len(self.conv_dim      )
					SCREAMING_SNAKE_CASE_					:	List[Any]		  =			num_hidden_layers
					SCREAMING_SNAKE_CASE_					:	Optional[Any]		  =			intermediate_size
					SCREAMING_SNAKE_CASE_					:	Tuple		  =			hidden_act
					SCREAMING_SNAKE_CASE_					:	Dict		  =			num_attention_heads
					SCREAMING_SNAKE_CASE_					:	List[Any]		  =			hidden_dropout
					SCREAMING_SNAKE_CASE_					:	List[str]		  =			attention_dropout
					SCREAMING_SNAKE_CASE_					:	List[str]		  =			activation_dropout
					SCREAMING_SNAKE_CASE_					:	Tuple		  =			feat_proj_dropout
					SCREAMING_SNAKE_CASE_					:	Dict		  =			final_dropout
					SCREAMING_SNAKE_CASE_					:	Optional[Any]		  =			layerdrop
					SCREAMING_SNAKE_CASE_					:	Optional[int]		  =			layer_norm_eps
					SCREAMING_SNAKE_CASE_					:	Any		  =			initializer_range
					SCREAMING_SNAKE_CASE_					:	List[str]		  =			num_ctc_classes
					SCREAMING_SNAKE_CASE_					:	List[Any]		  =			vocab_size
					SCREAMING_SNAKE_CASE_					:	str		  =			do_stable_layer_norm
					SCREAMING_SNAKE_CASE_					:	Tuple		  =			use_weighted_layer_sum
					SCREAMING_SNAKE_CASE_					:	Union[str, Any]		  =			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
					SCREAMING_SNAKE_CASE_					:	str		  =			apply_spec_augment
					SCREAMING_SNAKE_CASE_					:	List[str]		  =			mask_time_prob
					SCREAMING_SNAKE_CASE_					:	Optional[int]		  =			mask_time_length
					SCREAMING_SNAKE_CASE_					:	Any		  =			mask_time_min_masks
					SCREAMING_SNAKE_CASE_					:	Any		  =			mask_feature_prob
					SCREAMING_SNAKE_CASE_					:	Dict		  =			mask_feature_length

					# parameters for pretraining with codevector quantized representations
					SCREAMING_SNAKE_CASE_					:	Any		  =			num_codevectors_per_group
					SCREAMING_SNAKE_CASE_					:	Optional[Any]		  =			num_codevector_groups
					SCREAMING_SNAKE_CASE_					:	Optional[int]		  =			contrastive_logits_temperature
					SCREAMING_SNAKE_CASE_					:	Dict		  =			num_negatives
					SCREAMING_SNAKE_CASE_					:	Dict		  =			codevector_dim
					SCREAMING_SNAKE_CASE_					:	Dict		  =			proj_codevector_dim
					SCREAMING_SNAKE_CASE_					:	List[Any]		  =			diversity_loss_weight

					# ctc loss
					SCREAMING_SNAKE_CASE_					:	Any		  =			ctc_loss_reduction
					SCREAMING_SNAKE_CASE_					:	Dict		  =			ctc_zero_infinity

					# adapter
					SCREAMING_SNAKE_CASE_					:	Optional[int]		  =			add_adapter
					SCREAMING_SNAKE_CASE_					:	str		  =			adapter_kernel_size
					SCREAMING_SNAKE_CASE_					:	List[str]		  =			adapter_stride
					SCREAMING_SNAKE_CASE_					:	List[str]		  =			num_adapter_layers
					SCREAMING_SNAKE_CASE_					:	Dict		  =			output_hidden_size or hidden_size

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

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






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













from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Features, Value
from .base import TaskTemplate




@dataclass(frozen=A__    )
class 			__UpperCamelCase    (							A__    ):
     __A	:  str							  =   field(default="""language-modeling"""	, metadata={"""include_in_asdict_even_if_is_default""": True}    )

     __A	:  ClassVar[Features]							  =   Features({"""text""": Value("""string"""    )}    )
     __A	:  ClassVar[Features]							  =   Features({}    )
     __A	:  str							  =   "text"





     @property
     def 		UpperCamelCase(     self					):
        return {self.text_column: "text"}