




"""simple docstring"""



from collections import OrderedDict
from typing import Mapping

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


SCREAMING_SNAKE_CASE    =	logging.get_logger(__name__)

SCREAMING_SNAKE_CASE    =	{
    "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      UpperCAmelCase_  (						A_							):
    lowercase__						 =				'''distilbert'''
    lowercase__						 =				{
        '''hidden_size''': '''dim''',
        '''num_attention_heads''': '''n_heads''',
        '''num_hidden_layers''': '''n_layers''',
    }




    def __init__(   self						:	str     ,			snake_case_						:	Dict=30_522     ,			snake_case_						:	Dict=512     ,			snake_case_						:	Optional[int]=False     ,			snake_case_						:	int=6     ,			snake_case_						:	int=12     ,			snake_case_						:	Any=768     ,			snake_case_						:	Union[str, Any]=4 * 768     ,			snake_case_						:	List[Any]=0.1     ,			snake_case_						:	int=0.1     ,			snake_case_						:	Tuple="gelu"     ,			snake_case_						:	Dict=0.02     ,			snake_case_						:	List[Any]=0.1     ,			snake_case_						:	int=0.2     ,			snake_case_						:	Optional[int]=0     ,			**snake_case_						:	List[Any]     ,			)				->							List[str]:




     '''simple docstring'''

     A__	=    vocab_size
     A__	=    max_position_embeddings
     A__	=    sinusoidal_pos_embds
     A__	=    n_layers
     A__	=    n_heads
     A__	=    dim
     A__	=    hidden_dim
     A__	=    dropout
     A__	=    attention_dropout
     A__	=    activation
     A__	=    initializer_range
     A__	=    qa_dropout
     A__	=    seq_classif_dropout
     super().__init__(**snake_case_     ,			pad_token_id=snake_case_				)






class      UpperCAmelCase_  (						A_							):




    @property
    def 							__magic_name__							(   self						:	Tuple				)				->							Mapping[str, Mapping[int, str]]:




     '''simple docstring'''

     if self.task == "multiple-choice":
      A__	=    {0: "batch", 1: "choice", 2: "sequence"}
     else:
      A__	=    {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_tf_available,
    is_torch_available,
    is_vision_available,
)


SCREAMING_SNAKE_CASE    =	{
    "configuration_mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileViTConfig", "MobileViTOnnxConfig"],
}

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE    =	["MobileViTFeatureExtractor"]
      SCREAMING_SNAKE_CASE    =	["MobileViTImageProcessor"]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE    =	[
          "MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST",
          "MobileViTForImageClassification",
          "MobileViTForSemanticSegmentation",
          "MobileViTModel",
          "MobileViTPreTrainedModel",
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE    =	[
          "TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST",
          "TFMobileViTForImageClassification",
          "TFMobileViTForSemanticSegmentation",
          "TFMobileViTModel",
          "TFMobileViTPreTrainedModel",
      ]

if TYPE_CHECKING:
      from .configuration_mobilevit import MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTConfig, MobileViTOnnxConfig

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .feature_extraction_mobilevit import MobileViTFeatureExtractor
            from .image_processing_mobilevit import MobileViTImageProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_mobilevit import (
                MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                MobileViTForImageClassification,
                MobileViTForSemanticSegmentation,
                MobileViTModel,
                MobileViTPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_mobilevit import (
                TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFMobileViTForImageClassification,
                TFMobileViTForSemanticSegmentation,
                TFMobileViTModel,
                TFMobileViTPreTrainedModel,
            )


else:
      import sys

      SCREAMING_SNAKE_CASE    =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





