

from collections import OrderedDict
from typing import Mapping

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


UpperCAmelCase__ :     Union[str, Any]				    =    logging.get_logger(__name__)

UpperCAmelCase__ :     Optional[int]				    =    {
    """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        a__       (   UpperCAmelCase       ):







  """simple docstring"""




  UpperCAmelCase__      : int			       ="""ibert"""


  def __init__(			self    : int				,				UpperCAmelCase__    : str=3_0_5_2_2				,				UpperCAmelCase__    : int=7_6_8				,				UpperCAmelCase__    : List[Any]=1_2				,				UpperCAmelCase__    : List[Any]=1_2				,				UpperCAmelCase__    : Tuple=3_0_7_2				,				UpperCAmelCase__    : int="gelu"				,				UpperCAmelCase__    : Any=0.1				,				UpperCAmelCase__    : Optional[int]=0.1				,				UpperCAmelCase__    : Tuple=5_1_2				,				UpperCAmelCase__    : Optional[Any]=2				,				UpperCAmelCase__    : Tuple=0.02				,				UpperCAmelCase__    : List[Any]=1e-12				,				UpperCAmelCase__    : List[str]=1				,				UpperCAmelCase__    : Dict=0				,				UpperCAmelCase__    : Tuple=2				,				UpperCAmelCase__    : Optional[int]="absolute"				,				UpperCAmelCase__    : Any=False				,				UpperCAmelCase__    : int="none"				,				**UpperCAmelCase__    : str				,				)					->Dict:
        """simple docstring"""







        super().__init__(pad_token_id=UpperCAmelCase__				,				bos_token_id=UpperCAmelCase__				,				eos_token_id=UpperCAmelCase__				,				**UpperCAmelCase__		)

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







class        a__       (   UpperCAmelCase       ):







  """simple docstring"""




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







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







from typing import TYPE_CHECKING

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


UpperCAmelCase__ :     List[Any]				    =    {"""configuration_vit""": ["""VIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ViTConfig""", """ViTOnnxConfig"""]}

try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__ :     Union[str, Any]				    =    ["""ViTFeatureExtractor"""]
  UpperCAmelCase__ :     List[Any]				    =    ["""ViTImageProcessor"""]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__ :     List[Any]				    =    [
      """VIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """ViTForImageClassification""",
      """ViTForMaskedImageModeling""",
      """ViTModel""",
      """ViTPreTrainedModel""",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__ :     Tuple				    =    [
      """TFViTForImageClassification""",
      """TFViTModel""",
      """TFViTPreTrainedModel""",
  ]

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__ :     str				    =    [
      """FlaxViTForImageClassification""",
      """FlaxViTModel""",
      """FlaxViTPreTrainedModel""",
  ]

if TYPE_CHECKING:
  from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig, ViTOnnxConfig

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .feature_extraction_vit import ViTFeatureExtractor
    from .image_processing_vit import ViTImageProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_vit import (
        VIT_PRETRAINED_MODEL_ARCHIVE_LIST,
        ViTForImageClassification,
        ViTForMaskedImageModeling,
        ViTModel,
        ViTPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_vit import TFViTForImageClassification, TFViTModel, TFViTPreTrainedModel

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_vit import FlaxViTForImageClassification, FlaxViTModel, FlaxViTPreTrainedModel


else:
  import sys

  UpperCAmelCase__ :     Optional[Any]				    =    _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




