



"""simple docstring"""







import functools
import operator

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


lowerCAmelCase_   						=   logging.get_logger(__name__)

lowerCAmelCase_   						=   {
    '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       (	A_    ):







		'''simple docstring'''





		lowerCAmelCase			:					Any   	=				"wavlm"







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






				"""simple docstring"""



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

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

				# ctc loss
				lowercase__   :    Any				=			ctc_loss_reduction
				lowercase__   :    Optional[Any]				=			ctc_zero_infinity

				# adapter
				lowercase__   :    Optional[Any]				=			add_adapter
				lowercase__   :    Tuple				=			adapter_kernel_size
				lowercase__   :    List[str]				=			adapter_stride
				lowercase__   :    Union[str, Any]				=			num_adapter_layers
				lowercase__   :    List[Any]				=			output_hidden_size or hidden_size

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

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







		@property
		def 					UpperCAmelCase    (	self						:  Union[str, Any]						)					->		int:






				"""simple docstring"""



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





"""simple docstring"""







from ...configuration_utils import PretrainedConfig


lowerCAmelCase_   						=   {
    'google/tapas-base-finetuned-sqa': (
        'https://huggingface.co/google/tapas-base-finetuned-sqa/resolve/main/config.json'
    ),
    'google/tapas-base-finetuned-wtq': (
        'https://huggingface.co/google/tapas-base-finetuned-wtq/resolve/main/config.json'
    ),
    'google/tapas-base-finetuned-wikisql-supervised': (
        'https://huggingface.co/google/tapas-base-finetuned-wikisql-supervised/resolve/main/config.json'
    ),
    'google/tapas-base-finetuned-tabfact': (
        'https://huggingface.co/google/tapas-base-finetuned-tabfact/resolve/main/config.json'
    ),
}
class        __A       (	A_    ):







		'''simple docstring'''





		lowerCAmelCase			:					str   	=				"tapas"







		def __init__(	self						:  List[Any]			,_snake_case						:  Dict=30_522			,_snake_case						:  Union[str, Any]=768			,_snake_case						:  int=12			,_snake_case						:  Union[str, Any]=12			,_snake_case						:  Union[str, Any]=3_072			,_snake_case						:  List[Any]="gelu"			,_snake_case						:  Optional[int]=0.1			,_snake_case						:  Tuple=0.1			,_snake_case						:  List[Any]=1_024			,_snake_case						:  Any=[3, 256, 256, 2, 256, 256, 10]			,_snake_case						:  List[Any]=0.02			,_snake_case						:  Union[str, Any]=1e-12			,_snake_case						:  str=0			,_snake_case						:  Any=10.0			,_snake_case						:  int=0			,_snake_case						:  Optional[Any]=1.0			,_snake_case						:  List[str]=None			,_snake_case						:  Tuple=1.0			,_snake_case						:  Tuple=False			,_snake_case						:  List[Any]=None			,_snake_case						:  int=1.0			,_snake_case						:  List[Any]=1.0			,_snake_case						:  Optional[int]=False			,_snake_case						:  Optional[int]=False			,_snake_case						:  Optional[int]="ratio"			,_snake_case						:  Any=None			,_snake_case						:  Union[str, Any]=None			,_snake_case						:  List[str]=64			,_snake_case						:  Optional[Any]=32			,_snake_case						:  Optional[Any]=False			,_snake_case						:  Optional[int]=True			,_snake_case						:  Dict=False			,_snake_case						:  Tuple=False			,_snake_case						:  int=True			,_snake_case						:  List[str]=False			,_snake_case						:  Dict=None			,_snake_case						:  Optional[int]=None			,**_snake_case						:  int			,)					->		List[Any]:






				"""simple docstring"""



				super().__init__(pad_token_id=_snake_case			,**_snake_case						)

				# BERT hyperparameters (with updated max_position_embeddings and type_vocab_sizes)
				lowercase__   :    Optional[int]				=			vocab_size
				lowercase__   :    List[str]				=			hidden_size
				lowercase__   :    Any				=			num_hidden_layers
				lowercase__   :    Optional[Any]				=			num_attention_heads
				lowercase__   :    Optional[int]				=			hidden_act
				lowercase__   :    List[Any]				=			intermediate_size
				lowercase__   :    List[Any]				=			hidden_dropout_prob
				lowercase__   :    Dict				=			attention_probs_dropout_prob
				lowercase__   :    str				=			max_position_embeddings
				lowercase__   :    Dict				=			type_vocab_sizes
				lowercase__   :    Optional[Any]				=			initializer_range
				lowercase__   :    Dict				=			layer_norm_eps

				# Fine-tuning task hyperparameters
				lowercase__   :    Any				=			positive_label_weight
				lowercase__   :    int				=			num_aggregation_labels
				lowercase__   :    List[str]				=			aggregation_loss_weight
				lowercase__   :    Optional[int]				=			use_answer_as_supervision
				lowercase__   :    Optional[Any]				=			answer_loss_importance
				lowercase__   :    Union[str, Any]				=			use_normalized_answer_loss
				lowercase__   :    str				=			huber_loss_delta
				lowercase__   :    str				=			temperature
				lowercase__   :    int				=			aggregation_temperature
				lowercase__   :    List[Any]				=			use_gumbel_for_cells
				lowercase__   :    Tuple				=			use_gumbel_for_aggregation
				lowercase__   :    Union[str, Any]				=			average_approximation_function
				lowercase__   :    Union[str, Any]				=			cell_selection_preference
				lowercase__   :    Any				=			answer_loss_cutoff
				lowercase__   :    List[Any]				=			max_num_rows
				lowercase__   :    str				=			max_num_columns
				lowercase__   :    int				=			average_logits_per_cell
				lowercase__   :    str				=			select_one_column
				lowercase__   :    str				=			allow_empty_column_selection
				lowercase__   :    Any				=			init_cell_selection_weights_to_zero
				lowercase__   :    Optional[int]				=			reset_position_index_per_cell
				lowercase__   :    Union[str, Any]				=			disable_per_token_loss

				# Aggregation hyperparameters
				lowercase__   :    Optional[Any]				=			aggregation_labels
				lowercase__   :    List[Any]				=			no_aggregation_label_index

				if isinstance(self.aggregation_labels			,_snake_case						):
						lowercase__   :    Union[str, Any]				=			{int(_snake_case						): v for k, v in aggregation_labels.items()}
