import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


a  :      Tuple            =    {
    "debug": logging.DEBUG,
    "info": logging.INFO,
    "warning": logging.WARNING,
    "error": logging.ERROR,
    "critical": logging.CRITICAL,
}

a  :      List[str]            =    logging.WARNING
def 		snake_case__	(		):
   lowerCAmelCase_:							str       =	os.getenv("DATASETS_VERBOSITY"							,				lowercase					)
   if env_level_str:
      if env_level_str in log_levels:
         return log_levels[env_level_str]
      else:
         logging.getLogger().warning(
             F'''Unknown option DATASETS_VERBOSITY={env_level_str}, '''
             F'''has to be one of: { ", ".join(log_levels.keys()					) }'''					)
   return _default_log_level
def 		snake_case__	(		):
   return __name__.split("."					)[0]
def 		snake_case__	(		):
   return logging.getLogger(_get_library_name()					)
def 		snake_case__	(		):
   lowerCAmelCase_:							List[Any]       =	_get_library_root_logger()
   library_root_logger.setLevel(_get_default_logging_level()					)
def 		snake_case__	(		):
   lowerCAmelCase_:							Any       =	_get_library_root_logger()
   library_root_logger.setLevel(logging.NOTSET					)
def 		snake_case__	(		lowercase = None					):


   if name is None:
      lowerCAmelCase_:							Optional[int]       =	_get_library_name()
   return logging.getLogger(lowercase					)
def 		snake_case__	(		):
   return _get_library_root_logger().getEffectiveLevel()
def 		snake_case__	(		lowercase					):
   _get_library_root_logger().setLevel(lowercase					)
def 		snake_case__	(		):
   return set_verbosity(lowercase					)
def 		snake_case__	(		):
   return set_verbosity(lowercase					)
def 		snake_case__	(		):
   return set_verbosity(lowercase					)
def 		snake_case__	(		):
   return set_verbosity(lowercase					)
def 		snake_case__	(		):
   lowerCAmelCase_:							int       =	False
def 		snake_case__	(		):
   lowerCAmelCase_:							Optional[Any]       =	True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()

class 					_lowercase    :






    '''simple docstring'''




    def __init__(    self       ,						*lowerCamelCase__       ,						**lowerCamelCase__ ):  # pylint: disable=unused-argument
       lowerCAmelCase_:							Optional[int]       =	args[0] if args else None




    def __iter__(    self ):
       return iter(self._iterator )




    def __getattr__(    self       ,						lowerCamelCase__ ):

       def empty_fn(*lowerCamelCase__       ,						**lowerCamelCase__ ):  # pylint: disable=unused-argument
          return

       return empty_fn




    def __enter__(    self ):
       return self




    def __exit__(    self       ,						lowerCamelCase__       ,						lowerCamelCase__       ,						lowerCamelCase__ ):
       return





a  :      Any            =    True

class 					_lowercase    :






    '''simple docstring'''




    def __call__(    self       ,						*lowerCamelCase__       ,						lowerCamelCase__=False       ,						**lowerCamelCase__ ):
       if _tqdm_active and not disable:
          return tqdm_lib.tqdm(*lowerCAmelCase__       ,						**lowerCAmelCase__ )
       else:
          return EmptyTqdm(*lowerCAmelCase__       ,						**lowerCAmelCase__ )




    def      _a    (    self       ,						*lowerCamelCase__       ,						**lowerCamelCase__ ):
       lowerCAmelCase_:							List[str]       =	None
       if _tqdm_active:
          return tqdm_lib.tqdm.set_lock(*lowerCAmelCase__       ,						**lowerCAmelCase__ )




    def      _a    (    self ):
       if _tqdm_active:
          return tqdm_lib.tqdm.get_lock()





a  :      Union[str, Any]            =    _tqdm_cls()
def 		snake_case__	(		):
   global _tqdm_active
   return bool(_tqdm_active					)
def 		snake_case__	(		):
   global _tqdm_active
   lowerCAmelCase_:							List[Any]       =	True







def 		snake_case__	(		):
   global _tqdm_active
   lowerCAmelCase_:							List[str]       =	False

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
