'''simple docstring'''

from collections import OrderedDict
from typing import Mapping

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


_lowerCamelCase :				str														= logging.get_logger(__name__)

_lowerCamelCase :				Optional[Any]														= {
    """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    lowerCamelCase__  (   __snake_case     ):
   __UpperCAmelCase           =						"""electra"""



   def __init__(    self					,      lowerCAmelCase__=30_522					,      lowerCAmelCase__=128					,      lowerCAmelCase__=256					,      lowerCAmelCase__=12					,      lowerCAmelCase__=4					,      lowerCAmelCase__=1_024					,      lowerCAmelCase__="gelu"					,      lowerCAmelCase__=0.1					,      lowerCAmelCase__=0.1					,      lowerCAmelCase__=512					,      lowerCAmelCase__=2					,      lowerCAmelCase__=0.02					,      lowerCAmelCase__=1e-12					,      lowerCAmelCase__="first"					,      lowerCAmelCase__=True					,      lowerCAmelCase__="gelu"					,      lowerCAmelCase__=0.1					,      lowerCAmelCase__=0					,      lowerCAmelCase__="absolute"					,      lowerCAmelCase__=True					,      lowerCAmelCase__=None					,      **lowerCAmelCase__					,      )				->     Optional[int]:
        """simple docstring"""





        super().__init__(pad_token_id=lowerCAmelCase__					,      **lowerCAmelCase__     )

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

        _UpperCamelCase  :Optional[int]       =summary_type
        _UpperCamelCase  :List[str]       =summary_use_proj
        _UpperCamelCase  :Union[str, Any]       =summary_activation
        _UpperCamelCase  :List[str]       =summary_last_dropout
        _UpperCamelCase  :List[str]       =position_embedding_type
        _UpperCamelCase  :Optional[Any]       =use_cache
        _UpperCamelCase  :int       =classifier_dropout




class    lowerCamelCase__  (   __snake_case     ):



   @property
   def  _UpperCamelCase		(    self     )				->     Mapping[str, Mapping[int, str]]:
        """simple docstring"""





        if self.task == "multiple-choice":
             _UpperCamelCase  :Tuple       ={0: """batch""", 1: """choice""", 2: """sequence"""}
        else:
             _UpperCamelCase  :Dict       ={0: """batch""", 1: """sequence"""}
        return OrderedDict(
            [
                ("""input_ids""", dynamic_axis),
                ("""attention_mask""", dynamic_axis),
                ("""token_type_ids""", dynamic_axis),
            ]     )






'''simple docstring'''


from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_torch_available


_lowerCamelCase					:						str					     =							{
    'configuration_ernie_m': ['ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ErnieMConfig'],
}

try:
				if not is_sentencepiece_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCamelCase					:						List[str]					     =							['ErnieMTokenizer']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCamelCase					:						Union[str, Any]					     =							[
				    'ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'ErnieMForMultipleChoice',
				    'ErnieMForQuestionAnswering',
				    'ErnieMForSequenceClassification',
				    'ErnieMForTokenClassification',
				    'ErnieMModel',
				    'ErnieMPreTrainedModel',
				    'ErnieMForInformationExtraction',
				]


if TYPE_CHECKING:
				from .configuration_ernie_m import ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieMConfig

				try:
								if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_ernie_m import ErnieMTokenizer

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_ernie_m import (
								    ERNIE_M_PRETRAINED_MODEL_ARCHIVE_LIST,
								    ErnieMForInformationExtraction,
								    ErnieMForMultipleChoice,
								    ErnieMForQuestionAnswering,
								    ErnieMForSequenceClassification,
								    ErnieMForTokenClassification,
								    ErnieMModel,
								    ErnieMPreTrainedModel,
								)


else:
				import sys

				_lowerCamelCase					:						int					     =							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

