
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


__lowerCAmelCase			:     List[Any]           =   logging.get_logger(__name__)

__lowerCAmelCase			:     Dict           =   {
    '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'''







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







    """simple docstring"""






    super().__init__(**UpperCamelCase__    )

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

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

    __magic_name__				     =       pos_att_type
    __magic_name__				     =       vocab_size
    __magic_name__				     =       layer_norm_eps

    __magic_name__				     =       kwargs.get("""pooler_hidden_size"""			,							UpperCamelCase__    )
    __magic_name__				     =       pooler_dropout
    __magic_name__				     =       pooler_hidden_act







class        UpperCAmelCase_			( _A     ):


  '''simple docstring'''







  @property
  def 							_lowercase							( self			: Optional[int]    )			->	Mapping[str, Mapping[int, str]]:







    """simple docstring"""






    if self.task == "multiple-choice":
      __magic_name__				     =       {0: """batch""", 1: """choice""", 2: """sequence"""}
    else:
      __magic_name__				     =       {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 							_lowercase							( self			: Tuple    )			->	int:







    """simple docstring"""






    return 12





  def 							_lowercase							( self			: str			,							UpperCamelCase__			: Union["PreTrainedTokenizerBase", "FeatureExtractionMixin"]			,							UpperCamelCase__			: int = -1			,							UpperCamelCase__			: int = -1			,							UpperCamelCase__			: int = -1			,							UpperCamelCase__			: bool = False			,							UpperCamelCase__			: Optional["TensorType"] = None			,							UpperCamelCase__			: int = 3			,							UpperCamelCase__			: int = 40			,							UpperCamelCase__			: int = 40			,							UpperCamelCase__			: "PreTrainedTokenizerBase" = None			,							)			->	Mapping[str, Any]:







    """simple docstring"""






    __magic_name__				     =       super().generate_dummy_inputs(preprocessor=UpperCamelCase__			,							framework=UpperCamelCase__    )
    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_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__lowerCAmelCase			:     str           =   {
    'configuration_funnel': ['FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP', 'FunnelConfig'],
    'convert_funnel_original_tf_checkpoint_to_pytorch': [],
    'tokenization_funnel': ['FunnelTokenizer'],
}

try:
    if not is_tokenizers_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCAmelCase			:     Any           =   ['FunnelTokenizerFast']

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCAmelCase			:     Optional[int]           =   [
        'FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST',
        'FunnelBaseModel',
        'FunnelForMaskedLM',
        'FunnelForMultipleChoice',
        'FunnelForPreTraining',
        'FunnelForQuestionAnswering',
        'FunnelForSequenceClassification',
        'FunnelForTokenClassification',
        'FunnelModel',
        'FunnelPreTrainedModel',
        'load_tf_weights_in_funnel',
    ]

try:
    if not is_tf_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCAmelCase			:     Tuple           =   [
        'TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST',
        'TFFunnelBaseModel',
        'TFFunnelForMaskedLM',
        'TFFunnelForMultipleChoice',
        'TFFunnelForPreTraining',
        'TFFunnelForQuestionAnswering',
        'TFFunnelForSequenceClassification',
        'TFFunnelForTokenClassification',
        'TFFunnelModel',
        'TFFunnelPreTrainedModel',
    ]


if TYPE_CHECKING:
    from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
    from .tokenization_funnel import FunnelTokenizer

    try:
        if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_funnel_fast import FunnelTokenizerFast

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_funnel import (
            FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
            FunnelBaseModel,
            FunnelForMaskedLM,
            FunnelForMultipleChoice,
            FunnelForPreTraining,
            FunnelForQuestionAnswering,
            FunnelForSequenceClassification,
            FunnelForTokenClassification,
            FunnelModel,
            FunnelPreTrainedModel,
            load_tf_weights_in_funnel,
        )

    try:
        if not is_tf_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_tf_funnel import (
            TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
            TFFunnelBaseModel,
            TFFunnelForMaskedLM,
            TFFunnelForMultipleChoice,
            TFFunnelForPreTraining,
            TFFunnelForQuestionAnswering,
            TFFunnelForSequenceClassification,
            TFFunnelForTokenClassification,
            TFFunnelModel,
            TFFunnelPreTrainedModel,
        )

else:
    import sys

    __lowerCAmelCase			:     List[Any]           =   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

