


from collections import OrderedDict
from typing import Mapping

from packaging import version

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


lowerCamelCase		      = logging.get_logger(__name__)

lowerCamelCase		      = {
    'apple/mobilevit-small': 'https://huggingface.co/apple/mobilevit-small/resolve/main/config.json',
    'apple/mobilevit-x-small': 'https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json',
    'apple/mobilevit-xx-small': 'https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json',
    'apple/deeplabv3-mobilevit-small': (
        'https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json'
    ),
    'apple/deeplabv3-mobilevit-x-small': (
        'https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json'
    ),
    'apple/deeplabv3-mobilevit-xx-small': (
        'https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json'
    ),
    # See all MobileViT models at https://huggingface.co/models?filter=mobilevit
}




class A						(     UpperCamelCase_  ):
      UpperCamelCase__							:						str   ='mobilevit'






      def __init__(      self		:  Dict    ,     lowercase_		:  List[Any]=3    ,     lowercase_		:  Union[str, Any]=256    ,     lowercase_		:  str=2    ,     lowercase_		:  List[str]=[144, 192, 240]    ,     lowercase_		:  Optional[int]=[16, 32, 64, 96, 128, 160, 640]    ,     lowercase_		:  Optional[int]=4    ,     lowercase_		:  Any=2.0    ,     lowercase_		:  List[Any]=4.0    ,     lowercase_		:  Dict="silu"    ,     lowercase_		:  List[Any]=3    ,     lowercase_		:  Optional[int]=32    ,     lowercase_		:  str=0.1    ,     lowercase_		:  Optional[int]=0.0    ,     lowercase_		:  Dict=0.1    ,     lowercase_		:  str=0.02    ,     lowercase_		:  List[str]=1E-5    ,     lowercase_		:  Union[str, Any]=True    ,     lowercase_		:  Optional[int]=256    ,     lowercase_		:  Optional[Any]=[6, 12, 18]    ,     lowercase_		:  List[Any]=0.1    ,     lowercase_		:  Dict=255    ,     **lowercase_		:  str    ,     )      ->		Optional[int]:
             """simple docstring"""




             super().__init__(**lowercase_				)

             _lowerCamelCase :	Dict						=num_channels
             _lowerCamelCase :	Tuple						=image_size
             _lowerCamelCase :	Tuple						=patch_size
             _lowerCamelCase :	List[Any]						=hidden_sizes
             _lowerCamelCase :	Union[str, Any]						=neck_hidden_sizes
             _lowerCamelCase :	Optional[Any]						=num_attention_heads
             _lowerCamelCase :	Optional[int]						=mlp_ratio
             _lowerCamelCase :	str						=expand_ratio
             _lowerCamelCase :	List[Any]						=hidden_act
             _lowerCamelCase :	Union[str, Any]						=conv_kernel_size
             _lowerCamelCase :	Any						=output_stride
             _lowerCamelCase :	List[str]						=hidden_dropout_prob
             _lowerCamelCase :	Optional[int]						=attention_probs_dropout_prob
             _lowerCamelCase :	Tuple						=classifier_dropout_prob
             _lowerCamelCase :	Union[str, Any]						=initializer_range
             _lowerCamelCase :	Any						=layer_norm_eps
             _lowerCamelCase :	List[Any]						=qkv_bias

             # decode head attributes for semantic segmentation
             _lowerCamelCase :	Union[str, Any]						=aspp_out_channels
             _lowerCamelCase :	str						=atrous_rates
             _lowerCamelCase :	Tuple						=aspp_dropout_prob
             _lowerCamelCase :	List[Any]						=semantic_loss_ignore_index




class A						(     UpperCamelCase_  ):
      UpperCamelCase__							:						Optional[Any]   =version.parse('1.11'  )






      @property
      def  lowerCamelCase (      self		:  Tuple				)      ->		Mapping[str, Mapping[int, str]]:
             """simple docstring"""




             return OrderedDict([('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'})]				)






      @property
      def  lowerCamelCase (      self		:  Tuple				)      ->		Mapping[str, Mapping[int, str]]:
             """simple docstring"""




             if self.task == "image-classification":
                    return OrderedDict([('logits', {0: 'batch'})]				)
             else:
                    return OrderedDict([('last_hidden_state', {0: 'batch'}), ('pooler_output', {0: 'batch'})]				)






      @property
      def  lowerCamelCase (      self		:  Union[str, Any]				)      ->		float:
             """simple docstring"""




             return 1E-4






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowerCamelCase		      = {
    'configuration_deberta_v2': ['DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DebertaV2Config', 'DebertaV2OnnxConfig'],
    'tokenization_deberta_v2': ['DebertaV2Tokenizer'],
}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase		      = ['DebertaV2TokenizerFast']

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase		      = [
     'TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST',
     'TFDebertaV2ForMaskedLM',
     'TFDebertaV2ForQuestionAnswering',
     'TFDebertaV2ForSequenceClassification',
     'TFDebertaV2ForTokenClassification',
     'TFDebertaV2Model',
     'TFDebertaV2PreTrainedModel',
 ]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase		      = [
     'DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST',
     'DebertaV2ForMaskedLM',
     'DebertaV2ForMultipleChoice',
     'DebertaV2ForQuestionAnswering',
     'DebertaV2ForSequenceClassification',
     'DebertaV2ForTokenClassification',
     'DebertaV2Model',
     'DebertaV2PreTrainedModel',
 ]


if TYPE_CHECKING:
 from .configuration_deberta_va import (
     DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP,
     DebertaVaConfig,
     DebertaVaOnnxConfig,
 )
 from .tokenization_deberta_va import DebertaVaTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_deberta_va_fast import DebertaVaTokenizerFast

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_deberta_va import (
      TF_DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFDebertaVaForMaskedLM,
      TFDebertaVaForQuestionAnswering,
      TFDebertaVaForSequenceClassification,
      TFDebertaVaForTokenClassification,
      TFDebertaVaModel,
      TFDebertaVaPreTrainedModel,
  )

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_deberta_va import (
      DEBERTA_V2_PRETRAINED_MODEL_ARCHIVE_LIST,
      DebertaVaForMaskedLM,
      DebertaVaForMultipleChoice,
      DebertaVaForQuestionAnswering,
      DebertaVaForSequenceClassification,
      DebertaVaForTokenClassification,
      DebertaVaModel,
      DebertaVaPreTrainedModel,
  )

else:
 import sys

 lowerCamelCase		      = _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


