



"""simple docstring"""






import functools
import operator

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


__snake_case							:   str      =    logging.get_logger(__name__)

__snake_case							:   str      =    {
    '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__   (  __SCREAMING_SNAKE_CASE							):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE          =	'wavlm'

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

				"""simple docstring"""

				super().__init__(**__lowerCAmelCase       ,			pad_token_id=__lowerCAmelCase       ,			bos_token_id=__lowerCAmelCase       ,			eos_token_id=__lowerCAmelCase)
				__lowerCAmelCase      :  str												=       hidden_size
				__lowerCAmelCase      :  str												=       feat_extract_norm
				__lowerCAmelCase      :  str												=       feat_extract_activation
				__lowerCAmelCase      :  Tuple												=       list(__lowerCAmelCase)
				__lowerCAmelCase      :  Union[str, Any]												=       list(__lowerCAmelCase)
				__lowerCAmelCase      :  Union[str, Any]												=       list(__lowerCAmelCase)
				__lowerCAmelCase      :  List[str]												=       conv_bias
				__lowerCAmelCase      :  Optional[int]												=       num_buckets
				__lowerCAmelCase      :  Union[str, Any]												=       max_bucket_distance
				__lowerCAmelCase      :  Dict												=       num_conv_pos_embeddings
				__lowerCAmelCase      :  List[str]												=       num_conv_pos_embedding_groups
				__lowerCAmelCase      :  Union[str, Any]												=       len(self.conv_dim)
				__lowerCAmelCase      :  Union[str, Any]												=       num_hidden_layers
				__lowerCAmelCase      :  Union[str, Any]												=       intermediate_size
				__lowerCAmelCase      :  Optional[Any]												=       hidden_act
				__lowerCAmelCase      :  Tuple												=       num_attention_heads
				__lowerCAmelCase      :  Any												=       hidden_dropout
				__lowerCAmelCase      :  Optional[Any]												=       attention_dropout
				__lowerCAmelCase      :  Tuple												=       activation_dropout
				__lowerCAmelCase      :  Dict												=       feat_proj_dropout
				__lowerCAmelCase      :  Tuple												=       final_dropout
				__lowerCAmelCase      :  Union[str, Any]												=       layerdrop
				__lowerCAmelCase      :  Optional[Any]												=       layer_norm_eps
				__lowerCAmelCase      :  Optional[int]												=       initializer_range
				__lowerCAmelCase      :  Union[str, Any]												=       num_ctc_classes
				__lowerCAmelCase      :  Dict												=       vocab_size
				__lowerCAmelCase      :  List[str]												=       do_stable_layer_norm
				__lowerCAmelCase      :  Union[str, Any]												=       use_weighted_layer_sum
				__lowerCAmelCase      :  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
				__lowerCAmelCase      :  Union[str, Any]												=       apply_spec_augment
				__lowerCAmelCase      :  int												=       mask_time_prob
				__lowerCAmelCase      :  Union[str, Any]												=       mask_time_length
				__lowerCAmelCase      :  List[str]												=       mask_time_min_masks
				__lowerCAmelCase      :  List[str]												=       mask_feature_prob
				__lowerCAmelCase      :  Optional[Any]												=       mask_feature_length

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

				# ctc loss
				__lowerCAmelCase      :  Union[str, Any]												=       ctc_loss_reduction
				__lowerCAmelCase      :  Dict												=       ctc_zero_infinity

				# adapter
				__lowerCAmelCase      :  Tuple												=       add_adapter
				__lowerCAmelCase      :  Tuple												=       adapter_kernel_size
				__lowerCAmelCase      :  List[str]												=       adapter_stride
				__lowerCAmelCase      :  List[Any]												=       num_adapter_layers
				__lowerCAmelCase      :  int												=       output_hidden_size or hidden_size

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

				# XVector-specific parameters. Feel free to ignore for other classes.
				__lowerCAmelCase      :  Dict												=       list(__lowerCAmelCase)
				__lowerCAmelCase      :  Any												=       list(__lowerCAmelCase)
				__lowerCAmelCase      :  int												=       list(__lowerCAmelCase)
				__lowerCAmelCase      :  Tuple												=       xvector_output_dim







	@property
	def 							_SCREAMING_SNAKE_CASE   (     self:		int)				->       int:

				"""simple docstring"""

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






from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_a 						=      logging.get_logger(__name__)

_a 						=      {
    "camembert-base": "https://huggingface.co/camembert-base/resolve/main/config.json",
    "umberto-commoncrawl-cased-v1": (
        "https://huggingface.co/Musixmatch/umberto-commoncrawl-cased-v1/resolve/main/config.json"
    ),
    "umberto-wikipedia-uncased-v1": (
        "https://huggingface.co/Musixmatch/umberto-wikipedia-uncased-v1/resolve/main/config.json"
    ),
}






class 					__A    (    lowerCAmelCase ):

			'''simple docstring'''







			lowerCAmelCase_							     =						"""camembert"""





			def __init__(    self       ,  __lowerCAmelCase=3_0_5_2_2       ,  __lowerCAmelCase=7_6_8       ,  __lowerCAmelCase=1_2       ,  __lowerCAmelCase=1_2       ,  __lowerCAmelCase=3_0_7_2       ,  __lowerCAmelCase="gelu"       ,  __lowerCAmelCase=0.1       ,  __lowerCAmelCase=0.1       ,  __lowerCAmelCase=5_1_2       ,  __lowerCAmelCase=2       ,  __lowerCAmelCase=0.02       ,  __lowerCAmelCase=1E-12       ,  __lowerCAmelCase=1       ,  __lowerCAmelCase=0       ,  __lowerCAmelCase=2       ,  __lowerCAmelCase="absolute"       ,  __lowerCAmelCase=True       ,  __lowerCAmelCase=None       ,  **__lowerCAmelCase       ,  ):



				'''simple docstring'''







				super().__init__(pad_token_id=__lowerCAmelCase       ,  bos_token_id=__lowerCAmelCase       ,  eos_token_id=__lowerCAmelCase       ,  **__lowerCAmelCase							)

				lowerCamelCase__								=		vocab_size
				lowerCamelCase__								=		hidden_size
				lowerCamelCase__								=		num_hidden_layers
				lowerCamelCase__								=		num_attention_heads
				lowerCamelCase__								=		hidden_act
				lowerCamelCase__								=		intermediate_size
				lowerCamelCase__								=		hidden_dropout_prob
				lowerCamelCase__								=		attention_probs_dropout_prob
				lowerCamelCase__								=		max_position_embeddings
				lowerCamelCase__								=		type_vocab_size
				lowerCamelCase__								=		initializer_range
				lowerCamelCase__								=		layer_norm_eps
				lowerCamelCase__								=		position_embedding_type
				lowerCamelCase__								=		use_cache
				lowerCamelCase__								=		classifier_dropout






class 					__A    (    lowerCAmelCase ):

			'''simple docstring'''







			@property
			def 		__lowerCamelCase				(    self							):



				'''simple docstring'''







				if self.task == "multiple-choice":
					lowerCamelCase__								=		{0: '''batch''', 1: '''choice''', 2: '''sequence'''}
				else:
					lowerCamelCase__								=		{0: '''batch''', 1: '''sequence'''}
				return OrderedDict(
				    [
				        ('''input_ids''', dynamic_axis),
				        ('''attention_mask''', dynamic_axis),
				    ]							)



