





'''simple docstring'''




import functools
import operator

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


lowercase__   :				int      =   logging.get_logger(__name__)

lowercase__   :				Optional[int]      =   {
    '''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 			SCREAMING_SNAKE_CASE   (a__							):
     lowerCAmelCase		      =	'''wavlm'''


     def __init__(						self						,     _UpperCAmelCase=32						,     _UpperCAmelCase=768						,     _UpperCAmelCase=12						,     _UpperCAmelCase=12						,     _UpperCAmelCase=3072						,     _UpperCAmelCase="gelu"						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=0.0						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=0.02						,     _UpperCAmelCase=1e-5						,     _UpperCAmelCase="group"						,     _UpperCAmelCase="gelu"						,     _UpperCAmelCase=(512, 512, 512, 512, 512, 512, 512)						,     _UpperCAmelCase=(5, 2, 2, 2, 2, 2, 2)						,     _UpperCAmelCase=(10, 3, 3, 3, 3, 2, 2)						,     _UpperCAmelCase=False						,     _UpperCAmelCase=128						,     _UpperCAmelCase=16						,     _UpperCAmelCase=320						,     _UpperCAmelCase=800						,     _UpperCAmelCase=False						,     _UpperCAmelCase=True						,     _UpperCAmelCase=0.05						,     _UpperCAmelCase=10						,     _UpperCAmelCase=2						,     _UpperCAmelCase=0.0						,     _UpperCAmelCase=10						,     _UpperCAmelCase=320						,     _UpperCAmelCase=2						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=100						,     _UpperCAmelCase=256						,     _UpperCAmelCase=256						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase="mean"						,     _UpperCAmelCase=False						,     _UpperCAmelCase=False						,     _UpperCAmelCase=256						,     _UpperCAmelCase=(512, 512, 512, 512, 1500)						,     _UpperCAmelCase=(5, 3, 3, 1, 1)						,     _UpperCAmelCase=(1, 2, 3, 1, 1)						,     _UpperCAmelCase=512						,     _UpperCAmelCase=80						,     _UpperCAmelCase=0						,     _UpperCAmelCase=1						,     _UpperCAmelCase=2						,     _UpperCAmelCase=False						,     _UpperCAmelCase=3						,     _UpperCAmelCase=2						,     _UpperCAmelCase=3						,     _UpperCAmelCase=None						,     **_UpperCAmelCase						,     ):

          '''simple docstring'''






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

          # parameters for pretraining with codevector quantized representations
          __A						:			List[Any]								=	num_codevectors_per_group
          __A						:			List[Any]								=	num_codevector_groups
          __A						:			Optional[Any]								=	contrastive_logits_temperature
          __A						:			Tuple								=	num_negatives
          __A						:			Union[str, Any]								=	codevector_dim
          __A						:			Optional[Any]								=	proj_codevector_dim
          __A						:			List[Any]								=	diversity_loss_weight

          # ctc loss
          __A						:			Optional[int]								=	ctc_loss_reduction
          __A						:			Dict								=	ctc_zero_infinity

          # adapter
          __A						:			List[str]								=	add_adapter
          __A						:			Dict								=	adapter_kernel_size
          __A						:			List[Any]								=	adapter_stride
          __A						:			Dict								=	num_adapter_layers
          __A						:			List[str]								=	output_hidden_size or hidden_size

          # SequenceClassification-specific parameter. Feel free to ignore for other classes.
          __A						:			Optional[int]								=	classifier_proj_size

          # XVector-specific parameters. Feel free to ignore for other classes.
          __A						:			Tuple								=	list(_SCREAMING_SNAKE_CASE)
          __A						:			List[Any]								=	list(_SCREAMING_SNAKE_CASE)
          __A						:			List[Any]								=	list(_SCREAMING_SNAKE_CASE)
          __A						:			Any								=	xvector_output_dim


     @property
     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






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






'''simple docstring'''




from collections import OrderedDict
from typing import Mapping

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


lowercase__   :				Optional[Any]      =   logging.get_logger(__name__)

lowercase__   :				str      =   {
    '''andreasmadsen/efficient_mlm_m0.40''': (
        '''https://huggingface.co/andreasmadsen/efficient_mlm_m0.40/resolve/main/config.json'''
    ),
}


class 			SCREAMING_SNAKE_CASE   (a__							):
     lowerCAmelCase		      =	'''roberta-prelayernorm'''


     def __init__(						self						,     _UpperCAmelCase=5_0265						,     _UpperCAmelCase=768						,     _UpperCAmelCase=12						,     _UpperCAmelCase=12						,     _UpperCAmelCase=3072						,     _UpperCAmelCase="gelu"						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=0.1						,     _UpperCAmelCase=512						,     _UpperCAmelCase=2						,     _UpperCAmelCase=0.02						,     _UpperCAmelCase=1e-1_2						,     _UpperCAmelCase=1						,     _UpperCAmelCase=0						,     _UpperCAmelCase=2						,     _UpperCAmelCase="absolute"						,     _UpperCAmelCase=True						,     _UpperCAmelCase=None						,     **_UpperCAmelCase						,     ):

          '''simple docstring'''






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

          __A						:			Union[str, Any]								=	vocab_size
          __A						:			List[str]								=	hidden_size
          __A						:			Tuple								=	num_hidden_layers
          __A						:			List[str]								=	num_attention_heads
          __A						:			Tuple								=	hidden_act
          __A						:			Optional[Any]								=	intermediate_size
          __A						:			List[Any]								=	hidden_dropout_prob
          __A						:			Union[str, Any]								=	attention_probs_dropout_prob
          __A						:			Dict								=	max_position_embeddings
          __A						:			Any								=	type_vocab_size
          __A						:			Optional[int]								=	initializer_range
          __A						:			List[str]								=	layer_norm_eps
          __A						:			Optional[int]								=	position_embedding_type
          __A						:			Dict								=	use_cache
          __A						:			List[str]								=	classifier_dropout




class 			SCREAMING_SNAKE_CASE   (a__							):


     @property
     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






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