


from collections import OrderedDict
from typing import Mapping

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


UpperCAmelCase__       =							logging.get_logger(__name__)

UpperCAmelCase__       =							{
    """google/mobilebert-uncased""": """https://huggingface.co/google/mobilebert-uncased/resolve/main/config.json"""
}







class 				lowerCamelCase__       (	snake_case__):
     SCREAMING_SNAKE_CASE__				      =      MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP
     SCREAMING_SNAKE_CASE__				      =      "mobilebert"





     def __init__(self		,					UpperCAmelCase=3_0_5_2_2		,					UpperCAmelCase=5_1_2		,					UpperCAmelCase=2_4		,					UpperCAmelCase=4		,					UpperCAmelCase=5_1_2		,					UpperCAmelCase="relu"		,					UpperCAmelCase=0.0		,					UpperCAmelCase=0.1		,					UpperCAmelCase=5_1_2		,					UpperCAmelCase=2		,					UpperCAmelCase=0.02		,					UpperCAmelCase=1e-12		,					UpperCAmelCase=0		,					UpperCAmelCase=1_2_8		,					UpperCAmelCase=True		,					UpperCAmelCase=True		,					UpperCAmelCase=1_2_8		,					UpperCAmelCase=False		,					UpperCAmelCase=True		,					UpperCAmelCase=4		,					UpperCAmelCase="no_norm"		,					UpperCAmelCase=True		,					UpperCAmelCase=None		,					**UpperCAmelCase		,					)					->       List[Any]:
      super().__init__(pad_token_id=UpperCAmelCase		,					**UpperCAmelCase	)

      _lowercase											=vocab_size
      _lowercase											=hidden_size
      _lowercase											=num_hidden_layers
      _lowercase											=num_attention_heads
      _lowercase											=hidden_act
      _lowercase											=intermediate_size
      _lowercase											=hidden_dropout_prob
      _lowercase											=attention_probs_dropout_prob
      _lowercase											=max_position_embeddings
      _lowercase											=type_vocab_size
      _lowercase											=initializer_range
      _lowercase											=layer_norm_eps
      _lowercase											=embedding_size
      _lowercase											=trigram_input
      _lowercase											=use_bottleneck
      _lowercase											=intra_bottleneck_size
      _lowercase											=use_bottleneck_attention
      _lowercase											=key_query_shared_bottleneck
      _lowercase											=num_feedforward_networks
      _lowercase											=normalization_type
      _lowercase											=classifier_activation

      if self.use_bottleneck:
       _lowercase											=intra_bottleneck_size
      else:
       _lowercase											=hidden_size

      _lowercase											=classifier_dropout







class 				lowerCamelCase__       (	snake_case__):





     @property
     def 					__A (self	)					->       Optional[Any]:
      if self.task == "multiple-choice":
       _lowercase											={0: "batch", 1: "choice", 2: "sequence"}
      else:
       _lowercase											={0: "batch", 1: "sequence"}
      return OrderedDict(
          [
              ('''input_ids''', dynamic_axis),
              ('''attention_mask''', dynamic_axis),
              ('''token_type_ids''', dynamic_axis),
          ]	)





from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCAmelCase__            =							logging.get_logger(__name__)

UpperCAmelCase__            =							{
    '''bert-base-uncased''': '''https://huggingface.co/bert-base-uncased/resolve/main/config.json''',
    # QDQBERT models can be loaded from any BERT checkpoint, available at https://huggingface.co/models?filter=bert
}







class 				lowerCamelCase__       (	lowerCAmelCase):
     SCREAMING_SNAKE_CASE__				      =      '''qdqbert'''





     def __init__(self		,					UpperCAmelCase=3_0_5_2_2		,					UpperCAmelCase=7_6_8		,					UpperCAmelCase=1_2		,					UpperCAmelCase=1_2		,					UpperCAmelCase=3_0_7_2		,					UpperCAmelCase="gelu"		,					UpperCAmelCase=0.1		,					UpperCAmelCase=0.1		,					UpperCAmelCase=5_1_2		,					UpperCAmelCase=2		,					UpperCAmelCase=0.02		,					UpperCAmelCase=1e-12		,					UpperCAmelCase=True		,					UpperCAmelCase=1		,					UpperCAmelCase=0		,					UpperCAmelCase=2		,					**UpperCAmelCase		,					)					->       str:
      super().__init__(pad_token_id=UpperCAmelCase		,					bos_token_id=UpperCAmelCase		,					eos_token_id=UpperCAmelCase		,					**UpperCAmelCase	)

      _lowercase											=vocab_size
      _lowercase											=max_position_embeddings
      _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											=initializer_range
      _lowercase											=type_vocab_size
      _lowercase											=layer_norm_eps
      _lowercase											=use_cache

