



"""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[int]      						=						logging.get_logger(__name__)

_lowercase : Optional[int]      						=						{
    "xlm-mlm-en-2048": "https://huggingface.co/xlm-mlm-en-2048/resolve/main/config.json",
    "xlm-mlm-ende-1024": "https://huggingface.co/xlm-mlm-ende-1024/resolve/main/config.json",
    "xlm-mlm-enfr-1024": "https://huggingface.co/xlm-mlm-enfr-1024/resolve/main/config.json",
    "xlm-mlm-enro-1024": "https://huggingface.co/xlm-mlm-enro-1024/resolve/main/config.json",
    "xlm-mlm-tlm-xnli15-1024": "https://huggingface.co/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json",
    "xlm-mlm-xnli15-1024": "https://huggingface.co/xlm-mlm-xnli15-1024/resolve/main/config.json",
    "xlm-clm-enfr-1024": "https://huggingface.co/xlm-clm-enfr-1024/resolve/main/config.json",
    "xlm-clm-ende-1024": "https://huggingface.co/xlm-clm-ende-1024/resolve/main/config.json",
    "xlm-mlm-17-1280": "https://huggingface.co/xlm-mlm-17-1280/resolve/main/config.json",
    "xlm-mlm-100-1280": "https://huggingface.co/xlm-mlm-100-1280/resolve/main/config.json",
}

class        __SCREAMING_SNAKE_CASE	(      lowerCAmelCase_   ):


					'''simple docstring'''





					_a   			=							'xlm'
					_a   			=							{
					    'hidden_size': 'emb_dim',
					    'num_attention_heads': 'n_heads',
					    'num_hidden_layers': 'n_layers',
					    'n_words': 'vocab_size',  # For backward compatibility
					}



					def __init__(       self							:  Any,  lowerCamelCase							:  Optional[int]=3_0145,  lowerCamelCase							:  Any=2048,  lowerCamelCase							:  str=12,  lowerCamelCase							:  List[str]=16,  lowerCamelCase							:  Any=0.1,  lowerCamelCase							:  Tuple=0.1,  lowerCamelCase							:  List[Any]=True,  lowerCamelCase							:  List[Any]=False,  lowerCamelCase							:  Optional[Any]=False,  lowerCamelCase							:  str=False,  lowerCamelCase							:  Dict=1,  lowerCamelCase							:  Union[str, Any]=True,  lowerCamelCase							:  Optional[int]=512,  lowerCamelCase							:  int=2048**-0.5,  lowerCamelCase							:  Union[str, Any]=1E-12,  lowerCamelCase							:  Tuple=0.02,  lowerCamelCase							:  List[str]=0,  lowerCamelCase							:  str=1,  lowerCamelCase							:  Tuple=2,  lowerCamelCase							:  List[str]=3,  lowerCamelCase							:  Any=5,  lowerCamelCase							:  List[Any]=True,  lowerCamelCase							:  Tuple="first",  lowerCamelCase							:  List[str]=True,  lowerCamelCase							:  Union[str, Any]=None,  lowerCamelCase							:  Any=True,  lowerCamelCase							:  Union[str, Any]=0.1,  lowerCamelCase							:  str=5,  lowerCamelCase							:  Tuple=5,  lowerCamelCase							:  Any=0,  lowerCamelCase							:  str=0,  lowerCamelCase							:  str=2,  lowerCamelCase							:  Optional[Any]=0,  **lowerCamelCase							:  Dict,  )->					str:
								lowerCamelCase__		:		Any			=vocab_size
								lowerCamelCase__		:		Union[str, Any]			=emb_dim
								lowerCamelCase__		:		Union[str, Any]			=n_layers
								lowerCamelCase__		:		Optional[Any]			=n_heads
								lowerCamelCase__		:		Optional[int]			=dropout
								lowerCamelCase__		:		Tuple			=attention_dropout
								lowerCamelCase__		:		Optional[Any]			=gelu_activation
								lowerCamelCase__		:		Any			=sinusoidal_embeddings
								lowerCamelCase__		:		List[Any]			=causal
								lowerCamelCase__		:		List[str]			=asm
								lowerCamelCase__		:		Optional[Any]			=n_langs
								lowerCamelCase__		:		Optional[Any]			=use_lang_emb
								lowerCamelCase__		:		int			=layer_norm_eps
								lowerCamelCase__		:		Union[str, Any]			=bos_index
								lowerCamelCase__		:		List[Any]			=eos_index
								lowerCamelCase__		:		Dict			=pad_index
								lowerCamelCase__		:		Dict			=unk_index
								lowerCamelCase__		:		Tuple			=mask_index
								lowerCamelCase__		:		Dict			=is_encoder
								lowerCamelCase__		:		Optional[Any]			=max_position_embeddings
								lowerCamelCase__		:		List[Any]			=embed_init_std
								lowerCamelCase__		:		int			=init_std
								lowerCamelCase__		:		Optional[int]			=summary_type
								lowerCamelCase__		:		Optional[Any]			=summary_use_proj
								lowerCamelCase__		:		List[str]			=summary_activation
								lowerCamelCase__		:		str			=summary_proj_to_labels
								lowerCamelCase__		:		Dict			=summary_first_dropout
								lowerCamelCase__		:		Optional[int]			=start_n_top
								lowerCamelCase__		:		Any			=end_n_top
								lowerCamelCase__		:		Tuple			=mask_token_id
								lowerCamelCase__		:		Optional[Any]			=lang_id

								if "n_words" in kwargs:
											lowerCamelCase__		:		Dict			=kwargs['''n_words''']

								super().__init__(pad_token_id=lowerCamelCase,  bos_token_id=lowerCamelCase,  **lowerCamelCase     )





class        __SCREAMING_SNAKE_CASE	(      lowerCAmelCase_   ):


					'''simple docstring'''





					@property
					def 		snake_case       (       self							:  str     )->					Mapping[str, Mapping[int, str]]:
								if self.task == "multiple-choice":
											lowerCamelCase__		:		str			={0: '''batch''', 1: '''choice''', 2: '''sequence'''}
								else:
											lowerCamelCase__		:		List[Any]			={0: '''batch''', 1: '''sequence'''}
								return OrderedDict(
								    [
								        ('''input_ids''', dynamic_axis),
								        ('''attention_mask''', dynamic_axis),
								        ('''token_type_ids''', dynamic_axis),
								    ]     )









"""simple docstring"""






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


_lowercase : List[str]      						=						logging.get_logger(__name__)

_lowercase : int      						=						{
    "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        __SCREAMING_SNAKE_CASE	(      lowerCAmelCase_   ):


					'''simple docstring'''





					_a   			=							'deberta-v2'



					def __init__(       self							:  Optional[Any],  lowerCamelCase							:  Optional[int]=12_8100,  lowerCamelCase							:  List[Any]=1536,  lowerCamelCase							:  Dict=24,  lowerCamelCase							:  Any=24,  lowerCamelCase							:  Union[str, Any]=6144,  lowerCamelCase							:  List[Any]="gelu",  lowerCamelCase							:  int=0.1,  lowerCamelCase							:  Union[str, Any]=0.1,  lowerCamelCase							:  Union[str, Any]=512,  lowerCamelCase							:  Optional[Any]=0,  lowerCamelCase							:  Any=0.02,  lowerCamelCase							:  int=1E-7,  lowerCamelCase							:  Union[str, Any]=False,  lowerCamelCase							:  Union[str, Any]=-1,  lowerCamelCase							:  Tuple=0,  lowerCamelCase							:  Union[str, Any]=True,  lowerCamelCase							:  int=None,  lowerCamelCase							:  Dict=0,  lowerCamelCase							:  Tuple="gelu",  **lowerCamelCase							:  Optional[int],  )->					Union[str, Any]:
								super().__init__(**lowerCamelCase     )

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

								# Backwards compatibility
								if type(lowerCamelCase     ) == str:
											lowerCamelCase__		:		Union[str, Any]			=[x.strip() for x in pos_att_type.lower().split('''|'''     )]

								lowerCamelCase__		:		Tuple			=pos_att_type
								lowerCamelCase__		:		Union[str, Any]			=vocab_size
								lowerCamelCase__		:		Optional[int]			=layer_norm_eps

								lowerCamelCase__		:		Dict			=kwargs.get('''pooler_hidden_size''',  lowerCamelCase     )
								lowerCamelCase__		:		Tuple			=pooler_dropout
								lowerCamelCase__		:		List[Any]			=pooler_hidden_act





class        __SCREAMING_SNAKE_CASE	(      lowerCAmelCase_   ):


					'''simple docstring'''





					@property
					def 		snake_case       (       self							:  List[str]     )->					Mapping[str, Mapping[int, str]]:
								if self.task == "multiple-choice":
											lowerCamelCase__		:		Union[str, Any]			={0: '''batch''', 1: '''choice''', 2: '''sequence'''}
								else:
											lowerCamelCase__		:		Any			={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							:  List[str]     )->					int:
								return 12




					def 		snake_case       (       self							:  str,  lowerCamelCase							:  Union["PreTrainedTokenizerBase", "FeatureExtractionMixin"],  lowerCamelCase							:  int = -1,  lowerCamelCase							:  int = -1,  lowerCamelCase							:  int = -1,  lowerCamelCase							:  bool = False,  lowerCamelCase							:  Optional["TensorType"] = None,  lowerCamelCase							:  int = 3,  lowerCamelCase							:  int = 40,  lowerCamelCase							:  int = 40,  lowerCamelCase							:  "PreTrainedTokenizerBase" = None,  )->					Mapping[str, Any]:
								lowerCamelCase__		:		List[Any]			=super().generate_dummy_inputs(preprocessor=lowerCamelCase,  framework=lowerCamelCase     )
								if self._config.type_vocab_size == 0 and "token_type_ids" in dummy_inputs:
											del dummy_inputs["token_type_ids"]
								return dummy_inputs




