



from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional

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


if TYPE_CHECKING:
   from ... import FeatureExtractionMixin, TensorType

_lowercase						  =		logging.get_logger(__name__)

_lowercase						  =		{
    "openai/imagegpt-small": "",
    "openai/imagegpt-medium": "",
    "openai/imagegpt-large": "",
}



class     _UpperCAmelCase			(       lowercase__     ):
     UpperCamelCase__		    =				'''imagegpt'''
     UpperCamelCase__		    =				['''past_key_values''']
     UpperCamelCase__		    =				{
         '''hidden_size''': '''n_embd''',
         '''max_position_embeddings''': '''n_positions''',
         '''num_attention_heads''': '''n_head''',
         '''num_hidden_layers''': '''n_layer''',
     }




     def __init__(				self ,						a__=5_1_2 + 1 ,						a__=3_2 * 3_2 ,						a__=5_1_2 ,						a__=2_4 ,						a__=8 ,						a__=None ,						a__="quick_gelu" ,						a__=0.1 ,						a__=0.1 ,						a__=0.1 ,						a__=1e-5 ,						a__=0.0_2 ,						a__=True ,						a__=True ,						a__=False ,						a__=False ,						a__=False ,						**a__ ,						):
         A__		 =					vocab_size
         A__		 =					n_positions
         A__		 =					n_embd
         A__		 =					n_layer
         A__		 =					n_head
         A__		 =					n_inner
         A__		 =					activation_function
         A__		 =					resid_pdrop
         A__		 =					embd_pdrop
         A__		 =					attn_pdrop
         A__		 =					layer_norm_epsilon
         A__		 =					initializer_range
         A__		 =					scale_attn_weights
         A__		 =					use_cache
         A__		 =					scale_attn_by_inverse_layer_idx
         A__		 =					reorder_and_upcast_attn
         A__		 =					tie_word_embeddings

         super().__init__(tie_word_embeddings=a__ ,						**a__)







class     _UpperCAmelCase			(       lowercase__     ):




     @property
     def 		snake_case_		(				self):
         return OrderedDict(
             [
                 ('''input_ids''', {0: '''batch''', 1: '''sequence'''}),
             ])




     def 		snake_case_		(				self ,						a__ ,						a__ = 1 ,						a__ = -1 ,						a__ = False ,						a__ = None ,						a__ = 3 ,						a__ = 3_2 ,						a__ = 3_2 ,						):
         A__		 =					self._generate_dummy_images(a__ ,						a__ ,						a__ ,						a__)
         A__		 =					dict(preprocessor(images=a__ ,						return_tensors=a__))

         return inputs








from typing import TYPE_CHECKING

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


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

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

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

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowercase						  =		[
       "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

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