




from collections import OrderedDict
from typing import Mapping

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


a_      						=   logging.get_logger(__name__)

a_      						=   {
    "nghuyong/ernie-1.0-base-zh": "https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json",
    "nghuyong/ernie-2.0-base-en": "https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json",
    "nghuyong/ernie-2.0-large-en": "https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json",
    "nghuyong/ernie-3.0-base-zh": "https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json",
    "nghuyong/ernie-3.0-medium-zh": "https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json",
    "nghuyong/ernie-3.0-mini-zh": "https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json",
    "nghuyong/ernie-3.0-micro-zh": "https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json",
    "nghuyong/ernie-3.0-nano-zh": "https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json",
    "nghuyong/ernie-gram-zh": "https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json",
    "nghuyong/ernie-health-zh": "https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json",
}

class        _lowerCamelCase  (	_SCREAMING_SNAKE_CASE      ):

      """simple docstring"""

      lowerCAmelCase__	:       int			=    "ernie"







      def __init__(   self    :       Union[str, Any]       ,				snake_case    :       int=30522       ,				snake_case    :       Union[str, Any]=768       ,				snake_case    :       Dict=12       ,				snake_case    :       Any=12       ,				snake_case    :       Union[str, Any]=3072       ,				snake_case    :       List[Any]="gelu"       ,				snake_case    :       Dict=0.1       ,				snake_case    :       List[str]=0.1       ,				snake_case    :       Any=512       ,				snake_case    :       Optional[Any]=2       ,				snake_case    :       List[str]=3       ,				snake_case    :       Tuple=False       ,				snake_case    :       str=0.02       ,				snake_case    :       List[Any]=1E-12       ,				snake_case    :       Dict=0       ,				snake_case    :       Optional[int]="absolute"       ,				snake_case    :       int=True       ,				snake_case    :       List[Any]=None       ,				**snake_case    :       Optional[Any]       ,				):
          super().__init__(pad_token_id=snake_case       ,				**snake_case )

          __UpperCamelCase     						=  vocab_size
          __UpperCamelCase     						=  hidden_size
          __UpperCamelCase     						=  num_hidden_layers
          __UpperCamelCase     						=  num_attention_heads
          __UpperCamelCase     						=  hidden_act
          __UpperCamelCase     						=  intermediate_size
          __UpperCamelCase     						=  hidden_dropout_prob
          __UpperCamelCase     						=  attention_probs_dropout_prob
          __UpperCamelCase     						=  max_position_embeddings
          __UpperCamelCase     						=  type_vocab_size
          __UpperCamelCase     						=  task_type_vocab_size
          __UpperCamelCase     						=  use_task_id
          __UpperCamelCase     						=  initializer_range
          __UpperCamelCase     						=  layer_norm_eps
          __UpperCamelCase     						=  position_embedding_type
          __UpperCamelCase     						=  use_cache
          __UpperCamelCase     						=  classifier_dropout







class        _lowerCamelCase  (	_SCREAMING_SNAKE_CASE      ):

      """simple docstring"""

      @property
      def 					snake_case		(   self    :       Tuple ):
          if self.task == "multiple-choice":
              __UpperCamelCase     						=  {0: '''batch''', 1: '''choice''', 2: '''sequence'''}
          else:
              __UpperCamelCase     						=  {0: '''batch''', 1: '''sequence'''}
          return OrderedDict(
              [
                  ('''input_ids''', dynamic_axis),
                  ('''attention_mask''', dynamic_axis),
                  ('''token_type_ids''', dynamic_axis),
                  ('''task_type_ids''', dynamic_axis),
              ] )













from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_UpperCAmelCase				       = {
    'configuration_mpnet': ['MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MPNetConfig'],
    'tokenization_mpnet': ['MPNetTokenizer'],
}

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCAmelCase				       = ['MPNetTokenizerFast']

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCAmelCase				       = [
         'MPNET_PRETRAINED_MODEL_ARCHIVE_LIST',
         'MPNetForMaskedLM',
         'MPNetForMultipleChoice',
         'MPNetForQuestionAnswering',
         'MPNetForSequenceClassification',
         'MPNetForTokenClassification',
         'MPNetLayer',
         'MPNetModel',
         'MPNetPreTrainedModel',
     ]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCAmelCase				       = [
         'TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST',
         'TFMPNetEmbeddings',
         'TFMPNetForMaskedLM',
         'TFMPNetForMultipleChoice',
         'TFMPNetForQuestionAnswering',
         'TFMPNetForSequenceClassification',
         'TFMPNetForTokenClassification',
         'TFMPNetMainLayer',
         'TFMPNetModel',
         'TFMPNetPreTrainedModel',
     ]


if TYPE_CHECKING:
     from .configuration_mpnet import MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig
     from .tokenization_mpnet import MPNetTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_mpnet_fast import MPNetTokenizerFast

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_mpnet import (
              MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
              MPNetForMaskedLM,
              MPNetForMultipleChoice,
              MPNetForQuestionAnswering,
              MPNetForSequenceClassification,
              MPNetForTokenClassification,
              MPNetLayer,
              MPNetModel,
              MPNetPreTrainedModel,
          )

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_mpnet import (
              TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
              TFMPNetEmbeddings,
              TFMPNetForMaskedLM,
              TFMPNetForMultipleChoice,
              TFMPNetForQuestionAnswering,
              TFMPNetForSequenceClassification,
              TFMPNetForTokenClassification,
              TFMPNetMainLayer,
              TFMPNetModel,
              TFMPNetPreTrainedModel,
          )

else:
     import sys

     _UpperCAmelCase				       = _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

