
"""simple docstring"""




from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


A__   :						Tuple 							=     logging.get_logger(__name__)

A__   :						str 							=     {
    """google/electra-small-generator""": """https://huggingface.co/google/electra-small-generator/resolve/main/config.json""",
    """google/electra-base-generator""": """https://huggingface.co/google/electra-base-generator/resolve/main/config.json""",
    """google/electra-large-generator""": """https://huggingface.co/google/electra-large-generator/resolve/main/config.json""",
    """google/electra-small-discriminator""": (
        """https://huggingface.co/google/electra-small-discriminator/resolve/main/config.json"""
    ),
    """google/electra-base-discriminator""": (
        """https://huggingface.co/google/electra-base-discriminator/resolve/main/config.json"""
    ),
    """google/electra-large-discriminator""": (
        """https://huggingface.co/google/electra-large-discriminator/resolve/main/config.json"""
    ),
}







class 	_lowercase    (							lowerCAmelCase_					):


     '''simple docstring'''





     _A		    =				'electra'



     def __init__(   self			,      __UpperCamelCase=3_05_22			,      __UpperCamelCase=1_28			,      __UpperCamelCase=2_56			,      __UpperCamelCase=12			,      __UpperCamelCase=4			,      __UpperCamelCase=10_24			,      __UpperCamelCase="gelu"			,      __UpperCamelCase=0.1			,      __UpperCamelCase=0.1			,      __UpperCamelCase=5_12			,      __UpperCamelCase=2			,      __UpperCamelCase=0.02			,      __UpperCamelCase=1E-12			,      __UpperCamelCase="first"			,      __UpperCamelCase=True			,      __UpperCamelCase="gelu"			,      __UpperCamelCase=0.1			,      __UpperCamelCase=0			,      __UpperCamelCase="absolute"			,      __UpperCamelCase=True			,      __UpperCamelCase=None			,      **__UpperCamelCase			,      )->       List[Any]:
          super().__init__(pad_token_id=__UpperCamelCase			,      **__UpperCamelCase	)

          UpperCAmelCase__				:			Optional[int]							=    vocab_size
          UpperCAmelCase__				:			List[str]							=    embedding_size
          UpperCAmelCase__				:			Tuple							=    hidden_size
          UpperCAmelCase__				:			str							=    num_hidden_layers
          UpperCAmelCase__				:			List[str]							=    num_attention_heads
          UpperCAmelCase__				:			int							=    intermediate_size
          UpperCAmelCase__				:			str							=    hidden_act
          UpperCAmelCase__				:			int							=    hidden_dropout_prob
          UpperCAmelCase__				:			Dict							=    attention_probs_dropout_prob
          UpperCAmelCase__				:			Dict							=    max_position_embeddings
          UpperCAmelCase__				:			Dict							=    type_vocab_size
          UpperCAmelCase__				:			int							=    initializer_range
          UpperCAmelCase__				:			Optional[int]							=    layer_norm_eps

          UpperCAmelCase__				:			Dict							=    summary_type
          UpperCAmelCase__				:			Tuple							=    summary_use_proj
          UpperCAmelCase__				:			Optional[Any]							=    summary_activation
          UpperCAmelCase__				:			Union[str, Any]							=    summary_last_dropout
          UpperCAmelCase__				:			Optional[Any]							=    position_embedding_type
          UpperCAmelCase__				:			Optional[Any]							=    use_cache
          UpperCAmelCase__				:			Tuple							=    classifier_dropout







class 	_lowercase    (							lowerCAmelCase_					):


     '''simple docstring'''





     @property
     def 			lowerCAmelCase__							(   self	)->       Mapping[str, Mapping[int, str]]:
          if self.task == "multiple-choice":
               UpperCAmelCase__				:			List[Any]							=    {0: "batch", 1: "choice", 2: "sequence"}
          else:
               UpperCAmelCase__				:			List[str]							=    {0: "batch", 1: "sequence"}
          return OrderedDict(
              [
                  ("input_ids", dynamic_axis),
                  ("attention_mask", dynamic_axis),
                  ("token_type_ids", dynamic_axis),
              ]	)





"""simple docstring"""




import enum
import inspect
import warnings
from functools import wraps
from typing import Callable, Optional

from .logging import get_logger


A__   :						Optional[Any] 							=     set()
A__   :						List[str] 							=     get_logger(__name__)



def 				a__			(					lowerCAmelCase						:							Optional[str] = None		):






     '''simple docstring'''

     def decorator(lowerCAmelCase						:							Callable		):
          global _emitted_deprecation_warnings

          if inspect.isclass(lowerCAmelCase		):
               UpperCAmelCase__				:			Any							=    deprecated_class_or_function.__init__
               UpperCAmelCase__				:			Optional[int]							=    deprecated_class_or_function.__name__
          else:
               UpperCAmelCase__				:			str							=    deprecated_class_or_function
               UpperCAmelCase__				:			List[Any]							=    deprecated_function.__name__
               # Support deprecating __init__ class method: class name instead
               UpperCAmelCase__				:			List[str]							=    name if name != "__init__" else deprecated_function.__qualname__.split("."		)[-2]

          UpperCAmelCase__				:			Optional[Any]							=    (
              F"{name} is deprecated and will be removed in the next major version of datasets." + F" {help_message}"
              if help_message
              else ""
          )

          @wraps(lowerCAmelCase		)
          def wrapper(*lowerCAmelCase						:							int							,     **lowerCAmelCase						:							str		):
               UpperCAmelCase__				:			List[str]							=    hash(lowerCAmelCase		)
               if func_hash not in _emitted_deprecation_warnings:
                    warnings.warn(lowerCAmelCase							,     category=lowerCAmelCase							,     stacklevel=2		)
                    _emitted_deprecation_warnings.add(lowerCAmelCase		)
               return deprecated_function(*lowerCAmelCase							,     **lowerCAmelCase		)

          UpperCAmelCase__				:			List[str]							=    "deprecated"

          if inspect.isclass(lowerCAmelCase		):
               UpperCAmelCase__				:			List[str]							=    wrapper
               return deprecated_class_or_function
          else:
               return wrapper

     return decorator







class 	_lowercase    (							enum.EnumMeta					):


     '''simple docstring'''





     def __getattribute__(   cls			,      __UpperCamelCase	)->       Optional[Any]:
          UpperCAmelCase__				:			Optional[int]							=    super().__getattribute__(__UpperCamelCase	)
          if isinstance(__UpperCamelCase			,      enum.Enum	) and obj._on_access:
               obj._on_access()
          return obj



     def __getitem__(   cls			,      __UpperCamelCase	)->       Optional[int]:
          UpperCAmelCase__				:			Union[str, Any]							=    super().__getitem__(__UpperCamelCase	)
          if member._on_access:
               member._on_access()
          return member



     def __call__(   cls			,      __UpperCamelCase			,      __UpperCamelCase=None			,      *, __UpperCamelCase=None			,      __UpperCamelCase=None			,      __UpperCamelCase=None			,      __UpperCamelCase=1	)->       Dict:
          UpperCAmelCase__				:			Optional[int]							=    super().__call__(__UpperCamelCase			,      __UpperCamelCase			,      module=__UpperCamelCase			,      qualname=__UpperCamelCase			,      type=__UpperCamelCase			,      start=__UpperCamelCase	)
          if isinstance(__UpperCamelCase			,      enum.Enum	) and obj._on_access:
               obj._on_access()
          return obj







class 	_lowercase    (							enum.Enum						, metaclass=lowerCAmelCase_					):


     '''simple docstring'''





     def __new__(   cls			,      __UpperCamelCase	)->       Union[str, Any]:
          UpperCAmelCase__				:			int							=    object.__new__(cls	)
          UpperCAmelCase__				:			int							=    value
          UpperCAmelCase__				:			Optional[int]							=    member.deprecate
          return member



     @property
     def 			lowerCAmelCase__							(   self	)->       Union[str, Any]:
          return ""



     def 			lowerCAmelCase__							(   self	)->       int:
          UpperCAmelCase__				:			Tuple							=    F" {self.help_message}" if self.help_message else ""
          warnings.warn(
              F"'{self.__objclass__.__name__}' is deprecated and will be removed in the next major version of datasets."
              + help_message			,      __UpperCamelCase			,      stacklevel=3			,      )



