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


UpperCAmelCase     						=			logging.get_logger(__name__)

UpperCAmelCase     						=			{
    '''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    __lowerCAmelCase					(    a_  ):



 '''simple docstring'''
 _lowerCamelCase  :		List[str]			      =	"mobilevit"

 def __init__(     self    :						Optional[Any]    ,     lowerCamelCase    :						Union[str, Any]=3    ,     lowerCamelCase    :						Any=2_5_6    ,     lowerCamelCase    :						Any=2    ,     lowerCamelCase    :						str=[1_4_4, 1_9_2, 2_4_0]    ,     lowerCamelCase    :						Union[str, Any]=[1_6, 3_2, 6_4, 9_6, 1_2_8, 1_6_0, 6_4_0]    ,     lowerCamelCase    :						Tuple=4    ,     lowerCamelCase    :						Tuple=2.0    ,     lowerCamelCase    :						str=4.0    ,     lowerCamelCase    :						Union[str, Any]="silu"    ,     lowerCamelCase    :						Optional[int]=3    ,     lowerCamelCase    :						Any=3_2    ,     lowerCamelCase    :						List[Any]=0.1    ,     lowerCamelCase    :						Optional[Any]=0.0    ,     lowerCamelCase    :						List[Any]=0.1    ,     lowerCamelCase    :						List[Any]=0.0_2    ,     lowerCamelCase    :						int=1e-5    ,     lowerCamelCase    :						int=True    ,     lowerCamelCase    :						List[Any]=2_5_6    ,     lowerCamelCase    :						Tuple=[6, 1_2, 1_8]    ,     lowerCamelCase    :						Optional[Any]=0.1    ,     lowerCamelCase    :						Optional[Any]=2_5_5    ,     **lowerCamelCase    :						int    ,     )	->							Dict:
        super().__init__(**lowercase__					)

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

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







class    __lowerCAmelCase					(    a_  ):



 '''simple docstring'''
 _lowerCamelCase  :		Union[str, Any]			      =	version.parse('1.11'  )

 @property
 def    __snake_case   (     self    :						List[str]					)	->							Mapping[str, Mapping[int, str]]:
        return OrderedDict([('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'})]					)

 @property
 def    __snake_case   (     self    :						List[Any]					)	->							Mapping[str, Mapping[int, str]]:







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

 @property
 def    __snake_case   (     self    :						List[str]					)	->							float:
        return 1e-4




from typing import TYPE_CHECKING

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


UpperCAmelCase     						=			{
    '''configuration_mpnet''': ['''MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MPNetConfig'''],
    '''tokenization_mpnet''': ['''MPNetTokenizer'''],
}

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

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 UpperCAmelCase     						=			[
     '''MPNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''MPNetForMaskedLM''',
     '''MPNetForMultipleChoice''',
     '''MPNetForQuestionAnswering''',
     '''MPNetForSequenceClassification''',
     '''MPNetForTokenClassification''',
     '''MPNetLayer''',
     '''MPNetModel''',
     '''MPNetPreTrainedModel''',
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 UpperCAmelCase     						=			[
     '''TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''TFMPNetEmbeddings''',
     '''TFMPNetForMaskedLM''',
     '''TFMPNetForMultipleChoice''',
     '''TFMPNetForQuestionAnswering''',
     '''TFMPNetForSequenceClassification''',
     '''TFMPNetForTokenClassification''',
     '''TFMPNetMainLayer''',
     '''TFMPNetModel''',
     '''TFMPNetPreTrainedModel''',
 ]


if TYPE_CHECKING:
 from .configuration_mpnet import MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP, MPNetConfig
 from .tokenization_mpnet import MPNetTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_mpnet_fast import MPNetTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_mpnet import (
      MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
      MPNetForMaskedLM,
      MPNetForMultipleChoice,
      MPNetForQuestionAnswering,
      MPNetForSequenceClassification,
      MPNetForTokenClassification,
      MPNetLayer,
      MPNetModel,
      MPNetPreTrainedModel,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_mpnet import (
      TF_MPNET_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFMPNetEmbeddings,
      TFMPNetForMaskedLM,
      TFMPNetForMultipleChoice,
      TFMPNetForQuestionAnswering,
      TFMPNetForSequenceClassification,
      TFMPNetForTokenClassification,
      TFMPNetMainLayer,
      TFMPNetModel,
      TFMPNetPreTrainedModel,
  )

else:
 import sys

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



