
from typing import TYPE_CHECKING

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


_snake_case      :							str     	=    {
    "configuration_speech_to_text": ["SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2TextConfig"],
    "processing_speech_to_text": ["Speech2TextProcessor"],
}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_snake_case      :							str     	=    ["Speech2TextTokenizer"]

try:
						if not is_speech_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_snake_case      :							List[Any]     	=    ["Speech2TextFeatureExtractor"]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_snake_case      :							int     	=    [
						    "TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "TFSpeech2TextForConditionalGeneration",
						    "TFSpeech2TextModel",
						    "TFSpeech2TextPreTrainedModel",
						]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_snake_case      :							Dict     	=    [
						    "SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "Speech2TextForConditionalGeneration",
						    "Speech2TextModel",
						    "Speech2TextPreTrainedModel",
						]


if TYPE_CHECKING:
						from .configuration_speech_to_text import SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, SpeechaTextConfig
						from .processing_speech_to_text import SpeechaTextProcessor

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_speech_to_text import SpeechaTextTokenizer

						try:
												if not is_speech_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .feature_extraction_speech_to_text import SpeechaTextFeatureExtractor

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_speech_to_text import (
												    TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFSpeechaTextForConditionalGeneration,
												    TFSpeechaTextModel,
												    TFSpeechaTextPreTrainedModel,
												)

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_speech_to_text import (
												    SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    SpeechaTextForConditionalGeneration,
												    SpeechaTextModel,
												    SpeechaTextPreTrainedModel,
												)

else:
						import sys

						_snake_case      :							Tuple     	=    _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


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


_snake_case      :							Dict     	=    logging.get_logger(__name__)

_snake_case      :							List[str]     	=    {
    "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_      (      __a		):







						'''simple docstring'''



						UpperCamelCase      :  Optional[Any]				   =					'''deberta-v2'''





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

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

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

										lowercase         =      pos_att_type
										lowercase         =      vocab_size
										lowercase         =      layer_norm_eps

										lowercase         =      kwargs.get("pooler_hidden_size"		,    lowerCAmelCase__     )
										lowercase         =      pooler_dropout
										lowercase         =      pooler_hidden_act





class   UpperCamelCase_      (      __a		):







						'''simple docstring'''



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





						def        SCREAMING_SNAKE_CASE(			self							:Union[str, Any]		,    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]:
										lowercase         =      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
