



"""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    __lowercase     (					_UpperCAmelCase):







						"""simple docstring"""







						_A		:							List[str]							       =		"""wavlm"""







						def __init__(self   ,		lowercase__=32   ,		lowercase__=7_68   ,		lowercase__=12   ,		lowercase__=12   ,		lowercase__=30_72   ,		lowercase__="gelu"   ,		lowercase__=0.1   ,		lowercase__=0.1   ,		lowercase__=0.1   ,		lowercase__=0.0   ,		lowercase__=0.1   ,		lowercase__=0.1   ,		lowercase__=0.02   ,		lowercase__=1e-5   ,		lowercase__="group"   ,		lowercase__="gelu"   ,		lowercase__=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)   ,		lowercase__=(5, 2, 2, 2, 2, 2, 2)   ,		lowercase__=(10, 3, 3, 3, 3, 2, 2)   ,		lowercase__=False   ,		lowercase__=1_28   ,		lowercase__=16   ,		lowercase__=3_20   ,		lowercase__=8_00   ,		lowercase__=False   ,		lowercase__=True   ,		lowercase__=0.05   ,		lowercase__=10   ,		lowercase__=2   ,		lowercase__=0.0   ,		lowercase__=10   ,		lowercase__=3_20   ,		lowercase__=2   ,		lowercase__=0.1   ,		lowercase__=1_00   ,		lowercase__=2_56   ,		lowercase__=2_56   ,		lowercase__=0.1   ,		lowercase__="mean"   ,		lowercase__=False   ,		lowercase__=False   ,		lowercase__=2_56   ,		lowercase__=(5_12, 5_12, 5_12, 5_12, 15_00)   ,		lowercase__=(5, 3, 3, 1, 1)   ,		lowercase__=(1, 2, 3, 1, 1)   ,		lowercase__=5_12   ,		lowercase__=80   ,		lowercase__=0   ,		lowercase__=1   ,		lowercase__=2   ,		lowercase__=False   ,		lowercase__=3   ,		lowercase__=2   ,		lowercase__=3   ,		lowercase__=None   ,		**lowercase__   ,		):
											super().__init__(**lowercase__   ,		pad_token_id=lowercase__   ,		bos_token_id=lowercase__   ,		eos_token_id=lowercase__       )
											snake_case_					:		str 					=					hidden_size
											snake_case_					:		List[str] 					=					feat_extract_norm
											snake_case_					:		Tuple 					=					feat_extract_activation
											snake_case_					:		Any 					=					list(lowercase__       )
											snake_case_					:		Dict 					=					list(lowercase__       )
											snake_case_					:		Dict 					=					list(lowercase__       )
											snake_case_					:		Tuple 					=					conv_bias
											snake_case_					:		Optional[int] 					=					num_buckets
											snake_case_					:		List[Any] 					=					max_bucket_distance
											snake_case_					:		Union[str, Any] 					=					num_conv_pos_embeddings
											snake_case_					:		int 					=					num_conv_pos_embedding_groups
											snake_case_					:		List[Any] 					=					len(self.conv_dim       )
											snake_case_					:		Optional[int] 					=					num_hidden_layers
											snake_case_					:		Any 					=					intermediate_size
											snake_case_					:		Union[str, Any] 					=					hidden_act
											snake_case_					:		Dict 					=					num_attention_heads
											snake_case_					:		str 					=					hidden_dropout
											snake_case_					:		Optional[int] 					=					attention_dropout
											snake_case_					:		Union[str, Any] 					=					activation_dropout
											snake_case_					:		Dict 					=					feat_proj_dropout
											snake_case_					:		List[str] 					=					final_dropout
											snake_case_					:		Union[str, Any] 					=					layerdrop
											snake_case_					:		Tuple 					=					layer_norm_eps
											snake_case_					:		Union[str, Any] 					=					initializer_range
											snake_case_					:		Any 					=					num_ctc_classes
											snake_case_					:		str 					=					vocab_size
											snake_case_					:		Any 					=					do_stable_layer_norm
											snake_case_					:		Optional[int] 					=					use_weighted_layer_sum
											snake_case_					:		Optional[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
											snake_case_					:		Optional[Any] 					=					apply_spec_augment
											snake_case_					:		Tuple 					=					mask_time_prob
											snake_case_					:		Optional[Any] 					=					mask_time_length
											snake_case_					:		List[Any] 					=					mask_time_min_masks
											snake_case_					:		Optional[Any] 					=					mask_feature_prob
											snake_case_					:		Optional[int] 					=					mask_feature_length

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

											# ctc loss
											snake_case_					:		List[Any] 					=					ctc_loss_reduction
											snake_case_					:		Dict 					=					ctc_zero_infinity

											# adapter
											snake_case_					:		Any 					=					add_adapter
											snake_case_					:		Union[str, Any] 					=					adapter_kernel_size
											snake_case_					:		str 					=					adapter_stride
											snake_case_					:		str 					=					num_adapter_layers
											snake_case_					:		Optional[int] 					=					output_hidden_size or hidden_size

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

											# XVector-specific parameters. Feel free to ignore for other classes.
											snake_case_					:		str 					=					list(lowercase__       )
											snake_case_					:		List[str] 					=					list(lowercase__       )
											snake_case_					:		str 					=					list(lowercase__       )
											snake_case_					:		str 					=					xvector_output_dim







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









"""simple docstring"""

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


a_			   =					logging.get_logger(__name__)

a_			   =					{
    '''facebook/dpr-ctx_encoder-single-nq-base''': (
        '''https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-question_encoder-single-nq-base''': (
        '''https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-reader-single-nq-base''': (
        '''https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-ctx_encoder-multiset-base''': (
        '''https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-question_encoder-multiset-base''': (
        '''https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-reader-multiset-base''': (
        '''https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json'''
    ),
}







class    __lowercase     (					_UpperCAmelCase):







						"""simple docstring"""







						_A		:							Optional[int]							       =		"""dpr"""







						def __init__(self   ,		lowercase__=3_05_22   ,		lowercase__=7_68   ,		lowercase__=12   ,		lowercase__=12   ,		lowercase__=30_72   ,		lowercase__="gelu"   ,		lowercase__=0.1   ,		lowercase__=0.1   ,		lowercase__=5_12   ,		lowercase__=2   ,		lowercase__=0.02   ,		lowercase__=1e-12   ,		lowercase__=0   ,		lowercase__="absolute"   ,		lowercase__ = 0   ,		**lowercase__   ,		):
											super().__init__(pad_token_id=lowercase__   ,		**lowercase__       )

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




