



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			:     Optional[Any]     = logging.get_logger(__name__)

a			:     Any     = {
    'microsoft/deberta-base': 'https://huggingface.co/microsoft/deberta-base/resolve/main/config.json',
    'microsoft/deberta-large': 'https://huggingface.co/microsoft/deberta-large/resolve/main/config.json',
    'microsoft/deberta-xlarge': 'https://huggingface.co/microsoft/deberta-xlarge/resolve/main/config.json',
    'microsoft/deberta-base-mnli': 'https://huggingface.co/microsoft/deberta-base-mnli/resolve/main/config.json',
    'microsoft/deberta-large-mnli': 'https://huggingface.co/microsoft/deberta-large-mnli/resolve/main/config.json',
    'microsoft/deberta-xlarge-mnli': 'https://huggingface.co/microsoft/deberta-xlarge-mnli/resolve/main/config.json',
}







class 							_a							(      _lowerCAmelCase				):
			A					=  '''deberta'''

			def __init__(self,      SCREAMING_SNAKE_CASE_=50265,      SCREAMING_SNAKE_CASE_=768,      SCREAMING_SNAKE_CASE_=12,      SCREAMING_SNAKE_CASE_=12,      SCREAMING_SNAKE_CASE_=3072,      SCREAMING_SNAKE_CASE_="gelu",      SCREAMING_SNAKE_CASE_=0.1,      SCREAMING_SNAKE_CASE_=0.1,      SCREAMING_SNAKE_CASE_=512,      SCREAMING_SNAKE_CASE_=0,      SCREAMING_SNAKE_CASE_=0.0_2,      SCREAMING_SNAKE_CASE_=1E-7,      SCREAMING_SNAKE_CASE_=False,      SCREAMING_SNAKE_CASE_=-1,      SCREAMING_SNAKE_CASE_=0,      SCREAMING_SNAKE_CASE_=True,      SCREAMING_SNAKE_CASE_=None,      SCREAMING_SNAKE_CASE_=0,      SCREAMING_SNAKE_CASE_="gelu",      **SCREAMING_SNAKE_CASE_,      )					->      Tuple:
						super().__init__(**SCREAMING_SNAKE_CASE_				)

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

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

						UpperCAmelCase_:		Tuple       			=    pos_att_type
						UpperCAmelCase_:		Optional[Any]       			=    vocab_size
						UpperCAmelCase_:		List[Any]       			=    layer_norm_eps

						UpperCAmelCase_:		Optional[Any]       			=    kwargs.get("""pooler_hidden_size""",      SCREAMING_SNAKE_CASE_				)
						UpperCAmelCase_:		str       			=    pooler_dropout
						UpperCAmelCase_:		Optional[Any]       			=    pooler_hidden_act







class 							_a							(      _lowerCAmelCase				):

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

			def     __snake_case					(self,      SCREAMING_SNAKE_CASE_,      SCREAMING_SNAKE_CASE_ = -1,      SCREAMING_SNAKE_CASE_ = -1,      SCREAMING_SNAKE_CASE_ = -1,      SCREAMING_SNAKE_CASE_ = False,      SCREAMING_SNAKE_CASE_ = None,      SCREAMING_SNAKE_CASE_ = 3,      SCREAMING_SNAKE_CASE_ = 40,      SCREAMING_SNAKE_CASE_ = 40,      SCREAMING_SNAKE_CASE_ = None,      )					->      Mapping[str, Any]:
						UpperCAmelCase_:		int       			=    super().generate_dummy_inputs(preprocessor=SCREAMING_SNAKE_CASE_,      framework=SCREAMING_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_torch_available


a			:     List[str]     = {'configuration_visual_bert': ['VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'VisualBertConfig']}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	a			:     List[str]     = [
	    'VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'VisualBertForMultipleChoice',
	    'VisualBertForPreTraining',
	    'VisualBertForQuestionAnswering',
	    'VisualBertForRegionToPhraseAlignment',
	    'VisualBertForVisualReasoning',
	    'VisualBertLayer',
	    'VisualBertModel',
	    'VisualBertPreTrainedModel',
	]


if TYPE_CHECKING:
	from .configuration_visual_bert import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_visual_bert import (
		    VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    VisualBertForMultipleChoice,
		    VisualBertForPreTraining,
		    VisualBertForQuestionAnswering,
		    VisualBertForRegionToPhraseAlignment,
		    VisualBertForVisualReasoning,
		    VisualBertLayer,
		    VisualBertModel,
		    VisualBertPreTrainedModel,
		)


else:
	import sys

	a			:     Union[str, Any]     = _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






