



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_													=      logging.get_logger(__name__)

lowercase_													=      {
    '''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     __a			(  SCREAMING_SNAKE_CASE					):
	SCREAMING_SNAKE_CASE  	=							"deberta-v2"



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

						__lowerCAmelCase						 =hidden_size
						__lowerCAmelCase						 =num_hidden_layers
						__lowerCAmelCase						 =num_attention_heads
						__lowerCAmelCase						 =intermediate_size
						__lowerCAmelCase						 =hidden_act
						__lowerCAmelCase						 =hidden_dropout_prob
						__lowerCAmelCase						 =attention_probs_dropout_prob
						__lowerCAmelCase						 =max_position_embeddings
						__lowerCAmelCase						 =type_vocab_size
						__lowerCAmelCase						 =initializer_range
						__lowerCAmelCase						 =relative_attention
						__lowerCAmelCase						 =max_relative_positions
						__lowerCAmelCase						 =pad_token_id
						__lowerCAmelCase						 =position_biased_input

						# Backwards compatibility
						if type(snake_case_) == str:
											__lowerCAmelCase						 =[x.strip() for x in pos_att_type.lower().split("""|""")]

						__lowerCAmelCase						 =pos_att_type
						__lowerCAmelCase						 =vocab_size
						__lowerCAmelCase						 =layer_norm_eps

						__lowerCAmelCase						 =kwargs.get("""pooler_hidden_size"""					,						snake_case_)
						__lowerCAmelCase						 =pooler_dropout
						__lowerCAmelCase						 =pooler_hidden_act






class     __a			(  SCREAMING_SNAKE_CASE					):



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



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









from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowercase_													=      {
    '''configuration_albert''': ['''ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''AlbertConfig''', '''AlbertOnnxConfig'''],
}

try:
				if not is_sentencepiece_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_													=      ['''AlbertTokenizer''']

try:
				if not is_tokenizers_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_													=      ['''AlbertTokenizerFast''']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_													=      [
				    '''ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''AlbertForMaskedLM''',
				    '''AlbertForMultipleChoice''',
				    '''AlbertForPreTraining''',
				    '''AlbertForQuestionAnswering''',
				    '''AlbertForSequenceClassification''',
				    '''AlbertForTokenClassification''',
				    '''AlbertModel''',
				    '''AlbertPreTrainedModel''',
				    '''load_tf_weights_in_albert''',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_													=      [
				    '''TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''TFAlbertForMaskedLM''',
				    '''TFAlbertForMultipleChoice''',
				    '''TFAlbertForPreTraining''',
				    '''TFAlbertForQuestionAnswering''',
				    '''TFAlbertForSequenceClassification''',
				    '''TFAlbertForTokenClassification''',
				    '''TFAlbertMainLayer''',
				    '''TFAlbertModel''',
				    '''TFAlbertPreTrainedModel''',
				]

try:
				if not is_flax_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_													=      [
				    '''FlaxAlbertForMaskedLM''',
				    '''FlaxAlbertForMultipleChoice''',
				    '''FlaxAlbertForPreTraining''',
				    '''FlaxAlbertForQuestionAnswering''',
				    '''FlaxAlbertForSequenceClassification''',
				    '''FlaxAlbertForTokenClassification''',
				    '''FlaxAlbertModel''',
				    '''FlaxAlbertPreTrainedModel''',
				]

if TYPE_CHECKING:
				from .configuration_albert import ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, AlbertConfig, AlbertOnnxConfig

				try:
								if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_albert import AlbertTokenizer

				try:
								if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_albert_fast import AlbertTokenizerFast

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_albert import (
								    ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    AlbertForMaskedLM,
								    AlbertForMultipleChoice,
								    AlbertForPreTraining,
								    AlbertForQuestionAnswering,
								    AlbertForSequenceClassification,
								    AlbertForTokenClassification,
								    AlbertModel,
								    AlbertPreTrainedModel,
								    load_tf_weights_in_albert,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_albert import (
								    TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFAlbertForMaskedLM,
								    TFAlbertForMultipleChoice,
								    TFAlbertForPreTraining,
								    TFAlbertForQuestionAnswering,
								    TFAlbertForSequenceClassification,
								    TFAlbertForTokenClassification,
								    TFAlbertMainLayer,
								    TFAlbertModel,
								    TFAlbertPreTrainedModel,
								)

				try:
								if not is_flax_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_flax_albert import (
								    FlaxAlbertForMaskedLM,
								    FlaxAlbertForMultipleChoice,
								    FlaxAlbertForPreTraining,
								    FlaxAlbertForQuestionAnswering,
								    FlaxAlbertForSequenceClassification,
								    FlaxAlbertForTokenClassification,
								    FlaxAlbertModel,
								    FlaxAlbertPreTrainedModel,
								)
else:
				import sys

				lowercase_													=      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)




