




from collections import OrderedDict
from typing import Mapping

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


_UpperCAmelCase		:  Optional[int]	=   logging.get_logger(__name__)

_UpperCAmelCase		:  Union[str, Any]	=   {
    "distilbert-base-uncased": "https://huggingface.co/distilbert-base-uncased/resolve/main/config.json",
    "distilbert-base-uncased-distilled-squad": (
        "https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/config.json"
    ),
    "distilbert-base-cased": "https://huggingface.co/distilbert-base-cased/resolve/main/config.json",
    "distilbert-base-cased-distilled-squad": (
        "https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/config.json"
    ),
    "distilbert-base-german-cased": "https://huggingface.co/distilbert-base-german-cased/resolve/main/config.json",
    "distilbert-base-multilingual-cased": (
        "https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/config.json"
    ),
    "distilbert-base-uncased-finetuned-sst-2-english": (
        "https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json"
    ),
}




class       __lowerCAmelCase				(							lowerCAmelCase):
       _a           =  '''distilbert'''
       _a           =  {
           '''hidden_size''': '''dim''',
           '''num_attention_heads''': '''n_heads''',
           '''num_hidden_layers''': '''n_layers''',
       }






       def __init__(      self:    Tuple				,    _lowerCAmelCase:    str=3_05_22				,    _lowerCAmelCase:    Optional[int]=5_12				,    _lowerCAmelCase:    Optional[int]=False				,    _lowerCAmelCase:    Dict=6				,    _lowerCAmelCase:    List[str]=12				,    _lowerCAmelCase:    List[str]=7_68				,    _lowerCAmelCase:    List[Any]=4 * 7_68				,    _lowerCAmelCase:    Dict=0.1				,    _lowerCAmelCase:    List[str]=0.1				,    _lowerCAmelCase:    Optional[int]="gelu"				,    _lowerCAmelCase:    Union[str, Any]=0.02				,    _lowerCAmelCase:    List[Any]=0.1				,    _lowerCAmelCase:    List[Any]=0.2				,    _lowerCAmelCase:    Tuple=0				,    **_lowerCAmelCase:    Dict				,    ):
         lowercase			:List[Any]							=  vocab_size
         lowercase			:int							=  max_position_embeddings
         lowercase			:str							=  sinusoidal_pos_embds
         lowercase			:Optional[Any]							=  n_layers
         lowercase			:Tuple							=  n_heads
         lowercase			:Any							=  dim
         lowercase			:Optional[int]							=  hidden_dim
         lowercase			:Union[str, Any]							=  dropout
         lowercase			:List[str]							=  attention_dropout
         lowercase			:List[str]							=  activation
         lowercase			:int							=  initializer_range
         lowercase			:Union[str, Any]							=  qa_dropout
         lowercase			:List[str]							=  seq_classif_dropout
         super().__init__(**_lowerCAmelCase				,    pad_token_id=_lowerCAmelCase )







class       __lowerCAmelCase				(							lowerCAmelCase):






       @property
       def     SCREAMING_SNAKE_CASE			(      self:    Union[str, Any] ):
         if self.task == "multiple-choice":
           lowercase			:int							=  {0: "batch", 1: "choice", 2: "sequence"}
         else:
           lowercase			:Tuple							=  {0: "batch", 1: "sequence"}
         return OrderedDict(
             [
                 ("input_ids", dynamic_axis),
                 ("attention_mask", dynamic_axis),
             ] )









from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


_UpperCAmelCase		:  Tuple	=   {
    "susnato/ernie-m-base_pytorch": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json",
    "susnato/ernie-m-large_pytorch": "https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json",
}




class       __lowerCAmelCase				(							lowerCAmelCase):
       _a           =  '''ernie_m'''
       _a           =  {"dropout": "classifier_dropout", "num_classes": "num_labels"}






       def __init__(      self:    List[Any]				,    _lowerCAmelCase:    int = 25_00_02				,    _lowerCAmelCase:    int = 7_68				,    _lowerCAmelCase:    int = 12				,    _lowerCAmelCase:    int = 12				,    _lowerCAmelCase:    int = 30_72				,    _lowerCAmelCase:    str = "gelu"				,    _lowerCAmelCase:    float = 0.1				,    _lowerCAmelCase:    float = 0.1				,    _lowerCAmelCase:    int = 5_14				,    _lowerCAmelCase:    float = 0.02				,    _lowerCAmelCase:    int = 1				,    _lowerCAmelCase:    float = 1e-0_5				,    _lowerCAmelCase:    Dict=None				,    _lowerCAmelCase:    Optional[int]=False				,    _lowerCAmelCase:    List[str]=0.0				,    **_lowerCAmelCase:    Tuple				,    ):
         super().__init__(pad_token_id=_lowerCAmelCase				,    **_lowerCAmelCase )
         lowercase			:Tuple							=  vocab_size
         lowercase			:List[str]							=  hidden_size
         lowercase			:Optional[int]							=  num_hidden_layers
         lowercase			:Optional[Any]							=  num_attention_heads
         lowercase			:Optional[Any]							=  intermediate_size
         lowercase			:Optional[Any]							=  hidden_act
         lowercase			:Any							=  hidden_dropout_prob
         lowercase			:int							=  attention_probs_dropout_prob
         lowercase			:Dict							=  max_position_embeddings
         lowercase			:Optional[Any]							=  initializer_range
         lowercase			:Any							=  layer_norm_eps
         lowercase			:Union[str, Any]							=  classifier_dropout
         lowercase			:int							=  is_decoder
         lowercase			:List[str]							=  act_dropout



