


"""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


__a			 =   logging.get_logger(__name__)

__a			 =   {
    "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       (			lowerCAmelCase_ ):


							"""simple docstring"""
							SCREAMING_SNAKE_CASE										=      'mobilevit'






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

													UpperCAmelCase__		=    num_channels
													UpperCAmelCase__		=    image_size
													UpperCAmelCase__		=    patch_size
													UpperCAmelCase__		=    hidden_sizes
													UpperCAmelCase__		=    neck_hidden_sizes
													UpperCAmelCase__		=    num_attention_heads
													UpperCAmelCase__		=    mlp_ratio
													UpperCAmelCase__		=    expand_ratio
													UpperCAmelCase__		=    hidden_act
													UpperCAmelCase__		=    conv_kernel_size
													UpperCAmelCase__		=    output_stride
													UpperCAmelCase__		=    hidden_dropout_prob
													UpperCAmelCase__		=    attention_probs_dropout_prob
													UpperCAmelCase__		=    classifier_dropout_prob
													UpperCAmelCase__		=    initializer_range
													UpperCAmelCase__		=    layer_norm_eps
													UpperCAmelCase__		=    qkv_bias

													# decode head attributes for semantic segmentation
													UpperCAmelCase__		=    aspp_out_channels
													UpperCAmelCase__		=    atrous_rates
													UpperCAmelCase__		=    aspp_dropout_prob
													UpperCAmelCase__		=    semantic_loss_ignore_index




class 							lowerCamelCase       (			lowerCAmelCase_ ):


							"""simple docstring"""
							SCREAMING_SNAKE_CASE										=      version.parse("""1.11""" )






							@property
							def 					lowerCAmelCase     (						self :     Tuple				):
													return OrderedDict([('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''})]				)






							@property
							def 					lowerCAmelCase     (						self :     Union[str, Any]				):

													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 :     Any				):
													return 1E-4



"""simple docstring"""







from typing import TYPE_CHECKING

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


__a			 =   {
    "configuration_camembert": ["CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "CamembertConfig", "CamembertOnnxConfig"],
}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a			 =   ["CamembertTokenizer"]

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a			 =   ["CamembertTokenizerFast"]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a			 =   [
						    "CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "CamembertForCausalLM",
						    "CamembertForMaskedLM",
						    "CamembertForMultipleChoice",
						    "CamembertForQuestionAnswering",
						    "CamembertForSequenceClassification",
						    "CamembertForTokenClassification",
						    "CamembertModel",
						    "CamembertPreTrainedModel",
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a			 =   [
						    "TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "TFCamembertForCausalLM",
						    "TFCamembertForMaskedLM",
						    "TFCamembertForMultipleChoice",
						    "TFCamembertForQuestionAnswering",
						    "TFCamembertForSequenceClassification",
						    "TFCamembertForTokenClassification",
						    "TFCamembertModel",
						    "TFCamembertPreTrainedModel",
						]


if TYPE_CHECKING:
						from .configuration_camembert import CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, CamembertConfig, CamembertOnnxConfig

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_camembert import CamembertTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_camembert_fast import CamembertTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_camembert import (
												    CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    CamembertForCausalLM,
												    CamembertForMaskedLM,
												    CamembertForMultipleChoice,
												    CamembertForQuestionAnswering,
												    CamembertForSequenceClassification,
												    CamembertForTokenClassification,
												    CamembertModel,
												    CamembertPreTrainedModel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_camembert import (
												    TF_CAMEMBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFCamembertForCausalLM,
												    TFCamembertForMaskedLM,
												    TFCamembertForMultipleChoice,
												    TFCamembertForQuestionAnswering,
												    TFCamembertForSequenceClassification,
												    TFCamembertForTokenClassification,
												    TFCamembertModel,
												    TFCamembertPreTrainedModel,
												)

else:
						import sys

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