



from ...configuration_utils import PretrainedConfig


__A   			={
    "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 		UpperCAmelCase__			(			__UpperCamelCase   ):




			'''simple docstring'''






			UpperCamelCase									=       """tapas"""




			def __init__(   self							: Optional[Any]       ,       a_							: Dict=3_05_22       ,       a_							: Union[str, Any]=7_68       ,       a_							: List[Any]=12       ,       a_							: Optional[Any]=12       ,       a_							: List[Any]=30_72       ,       a_							: Union[str, Any]="gelu"       ,       a_							: Dict=0.1       ,       a_							: Dict=0.1       ,       a_							: Tuple=10_24       ,       a_							: str=[3, 2_56, 2_56, 2, 2_56, 2_56, 10]       ,       a_							: int=0.0_2       ,       a_							: Any=1e-12       ,       a_							: Optional[int]=0       ,       a_							: Tuple=1_0.0       ,       a_							: int=0       ,       a_							: Tuple=1.0       ,       a_							: Optional[Any]=None       ,       a_							: List[Any]=1.0       ,       a_							: Dict=False       ,       a_							: Optional[int]=None       ,       a_							: Optional[Any]=1.0       ,       a_							: Tuple=1.0       ,       a_							: str=False       ,       a_							: List[Any]=False       ,       a_							: Optional[Any]="ratio"       ,       a_							: Dict=None       ,       a_							: Dict=None       ,       a_							: Tuple=64       ,       a_							: Dict=32       ,       a_							: int=False       ,       a_							: List[str]=True       ,       a_							: List[str]=False       ,       a_							: int=False       ,       a_							: Optional[int]=True       ,       a_							: List[str]=False       ,       a_							: Union[str, Any]=None       ,       a_							: Any=None       ,       **a_							: Union[str, Any]       ,       ):
					'''simple docstring'''





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

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

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

					# Aggregation hyperparameters
					__UpperCAmelCase    :     str													=	aggregation_labels
					__UpperCAmelCase    :     Optional[int]													=	no_aggregation_label_index

					if isinstance(self.aggregation_labels       ,       a_ ):
							__UpperCAmelCase    :     str													=	{int(a_ ): v for k, v in aggregation_labels.items()}










from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional, Union

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


if TYPE_CHECKING:
				from ... import FeatureExtractionMixin, PreTrainedTokenizerBase, TensorType


__A   			=logging.get_logger(__name__)

__A   			={
    "microsoft/deberta-v2-xlarge": "https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json",
    "microsoft/deberta-v2-xxlarge": "https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/config.json",
    "microsoft/deberta-v2-xlarge-mnli": (
        "https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/config.json"
    ),
    "microsoft/deberta-v2-xxlarge-mnli": (
        "https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/config.json"
    ),
}

class 		UpperCAmelCase__			(			__UpperCamelCase   ):




			'''simple docstring'''






			UpperCamelCase									=       """deberta-v2"""




			def __init__(   self							: Optional[int]       ,       a_							: List[str]=12_81_00       ,       a_							: Optional[Any]=15_36       ,       a_							: Optional[Any]=24       ,       a_							: List[Any]=24       ,       a_							: Optional[int]=61_44       ,       a_							: List[Any]="gelu"       ,       a_							: Any=0.1       ,       a_							: Tuple=0.1       ,       a_							: Optional[Any]=5_12       ,       a_							: Tuple=0       ,       a_							: Dict=0.0_2       ,       a_							: Optional[Any]=1e-7       ,       a_							: List[str]=False       ,       a_							: List[Any]=-1       ,       a_							: List[str]=0       ,       a_							: Optional[Any]=True       ,       a_							: List[Any]=None       ,       a_							: Optional[int]=0       ,       a_							: Tuple="gelu"       ,       **a_							: List[str]       ,       ):
					'''simple docstring'''





					super().__init__(**a_ )

					__UpperCAmelCase    :     Any													=	hidden_size
					__UpperCAmelCase    :     Any													=	num_hidden_layers
					__UpperCAmelCase    :     List[Any]													=	num_attention_heads
					__UpperCAmelCase    :     Union[str, Any]													=	intermediate_size
					__UpperCAmelCase    :     List[str]													=	hidden_act
					__UpperCAmelCase    :     int													=	hidden_dropout_prob
					__UpperCAmelCase    :     List[str]													=	attention_probs_dropout_prob
					__UpperCAmelCase    :     str													=	max_position_embeddings
					__UpperCAmelCase    :     int													=	type_vocab_size
					__UpperCAmelCase    :     Tuple													=	initializer_range
					__UpperCAmelCase    :     Optional[int]													=	relative_attention
					__UpperCAmelCase    :     int													=	max_relative_positions
					__UpperCAmelCase    :     Any													=	pad_token_id
					__UpperCAmelCase    :     int													=	position_biased_input

					# Backwards compatibility
					if type(a_ ) == str:
							__UpperCAmelCase    :     Optional[Any]													=	[x.strip() for x in pos_att_type.lower().split('''|''' )]

					__UpperCAmelCase    :     Tuple													=	pos_att_type
					__UpperCAmelCase    :     int													=	vocab_size
					__UpperCAmelCase    :     Optional[Any]													=	layer_norm_eps

					__UpperCAmelCase    :     str													=	kwargs.get('''pooler_hidden_size'''       ,       a_ )
					__UpperCAmelCase    :     Union[str, Any]													=	pooler_dropout
					__UpperCAmelCase    :     Tuple													=	pooler_hidden_act

class 		UpperCAmelCase__			(			__UpperCamelCase   ):




			'''simple docstring'''






			@property
			def  snake_case__     (   self							: Optional[Any] ):
					'''simple docstring'''





					if self.task == "multiple-choice":
							__UpperCAmelCase    :     List[Any]													=	{0: '''batch''', 1: '''choice''', 2: '''sequence'''}
					else:
							__UpperCAmelCase    :     int													=	{0: '''batch''', 1: '''sequence'''}
					if self._config.type_vocab_size > 0:
							return OrderedDict(
							    [('''input_ids''', dynamic_axis), ('''attention_mask''', dynamic_axis), ('''token_type_ids''', dynamic_axis)] )
					else:
							return OrderedDict([('''input_ids''', dynamic_axis), ('''attention_mask''', dynamic_axis)] )




			@property
			def  snake_case__     (   self							: Union[str, Any] ):
					'''simple docstring'''





					return 12




			def  snake_case__     (   self							: Any       ,       a_							: Union["PreTrainedTokenizerBase", "FeatureExtractionMixin"]       ,       a_							: int = -1       ,       a_							: int = -1       ,       a_							: int = -1       ,       a_							: bool = False       ,       a_							: Optional["TensorType"] = None       ,       a_							: int = 3       ,       a_							: int = 40       ,       a_							: int = 40       ,       a_							: "PreTrainedTokenizerBase" = None       ,       ):
					'''simple docstring'''





					__UpperCAmelCase    :     List[Any]													=	super().generate_dummy_inputs(preprocessor=a_       ,       framework=a_ )
					if self._config.type_vocab_size == 0 and "token_type_ids" in dummy_inputs:
							del dummy_inputs["token_type_ids"]
					return dummy_inputs





