



'''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_							: List[Any]						 =	{
    """kssteven/ibert-roberta-base""": """https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json""",
    """kssteven/ibert-roberta-large""": """https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json""",
    """kssteven/ibert-roberta-large-mnli""": (
        """https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json"""
    ),
}



class 							lowercase       (  _lowerCamelCase				):


 """simple docstring"""


 UpperCAmelCase							=  """ibert"""







 def __init__(							self  ,a_=30_522  ,a_=768  ,a_=12  ,a_=12  ,a_=3_072  ,a_="gelu"  ,a_=0.1  ,a_=0.1  ,a_=512  ,a_=2  ,a_=0.02  ,a_=1E-1_2  ,a_=1  ,a_=0  ,a_=2  ,a_="absolute"  ,a_=False  ,a_="none"  ,**a_  ,)		->   Union[str, Any]:
        super().__init__(pad_token_id=a_  ,bos_token_id=a_  ,eos_token_id=a_  ,**a_							)

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







class 							lowercase       (  _lowerCamelCase				):


 """simple docstring"""


 @property
 def _snake_case (							self							)		->   Mapping[str, Mapping[int, str]]:
        if self.task == "multiple-choice":
               _UpperCAmelCase  :						Union[str, 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),
            ]							)








'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A_							: Optional[int]						 =	{"""configuration_ibert""": ["""IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """IBertConfig""", """IBertOnnxConfig"""]}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_							: str						 =	[
       """IBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """IBertForMaskedLM""",
       """IBertForMultipleChoice""",
       """IBertForQuestionAnswering""",
       """IBertForSequenceClassification""",
       """IBertForTokenClassification""",
       """IBertModel""",
       """IBertPreTrainedModel""",
   ]

if TYPE_CHECKING:
   from .configuration_ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig, IBertOnnxConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_ibert import (
          IBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          IBertForMaskedLM,
          IBertForMultipleChoice,
          IBertForQuestionAnswering,
          IBertForSequenceClassification,
          IBertForTokenClassification,
          IBertModel,
          IBertPreTrainedModel,
      )

else:
   import sys

   A_							: str						 =	_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



