




'''simple docstring'''




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


snake_case__          =						logging.get_logger(__name__)

snake_case__          =						{
    """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     UpperCamelCase_     (a__     ):







						"""simple docstring"""


						_lowerCAmelCase    						=					'mobilevit'







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





											"""simple docstring"""







											super().__init__(**_lowerCamelCase    )

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

											# decode head attributes for semantic segmentation
											A_ :     str =							aspp_out_channels
											A_ :     str =							atrous_rates
											A_ :     Optional[Any] =							aspp_dropout_prob
											A_ :     Optional[int] =							semantic_loss_ignore_index






class     UpperCamelCase_     (a__     ):







						"""simple docstring"""


						_lowerCAmelCase    						=					version.parse('1.11'     )







						@property
						def       _a    (     self      :       Dict    ):





											"""simple docstring"""







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







						@property
						def       _a    (     self      :       Any    ):





											"""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       _a    (     self      :       Optional[Any]    ):





											"""simple docstring"""







											return 1E-4









'''simple docstring'''




from ...configuration_utils import PretrainedConfig
from ...utils import logging


snake_case__          =						logging.get_logger(__name__)

snake_case__          =						{
    """bert-base-uncased""": """https://huggingface.co/bert-base-uncased/resolve/main/config.json""",
    # QDQBERT models can be loaded from any BERT checkpoint, available at https://huggingface.co/models?filter=bert
}






class     UpperCamelCase_     (a__     ):







						"""simple docstring"""


						_lowerCAmelCase    						=					'qdqbert'







						def __init__(     self      :       Union[str, Any]							, _lowerCamelCase      :       List[Any]=30522							, _lowerCamelCase      :       str=768							, _lowerCamelCase      :       Optional[Any]=12							, _lowerCamelCase      :       str=12							, _lowerCamelCase      :       List[Any]=3072							, _lowerCamelCase      :       Union[str, Any]="gelu"							, _lowerCamelCase      :       Dict=0.1							, _lowerCamelCase      :       Union[str, Any]=0.1							, _lowerCamelCase      :       Optional[int]=512							, _lowerCamelCase      :       Dict=2							, _lowerCamelCase      :       Optional[Any]=0.02							, _lowerCamelCase      :       List[Any]=1E-12							, _lowerCamelCase      :       Tuple=True							, _lowerCamelCase      :       Tuple=1							, _lowerCamelCase      :       Optional[Any]=0							, _lowerCamelCase      :       Optional[int]=2							, **_lowerCamelCase      :       List[str]							, ):





											"""simple docstring"""







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

											A_ :     Optional[Any] =							vocab_size
											A_ :     str =							max_position_embeddings
											A_ :     List[str] =							hidden_size
											A_ :     str =							num_hidden_layers
											A_ :     List[str] =							num_attention_heads
											A_ :     List[str] =							intermediate_size
											A_ :     int =							hidden_act
											A_ :     Tuple =							hidden_dropout_prob
											A_ :     Optional[Any] =							attention_probs_dropout_prob
											A_ :     Dict =							initializer_range
											A_ :     Optional[int] =							type_vocab_size
											A_ :     Any =							layer_norm_eps
											A_ :     Optional[int] =							use_cache



