






'''simple docstring'''





from typing import TYPE_CHECKING

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


__A							:							List[str]  							=		{
    """configuration_blip""": [
        """BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """BlipConfig""",
        """BlipTextConfig""",
        """BlipVisionConfig""",
    ],
    """processing_blip""": ["""BlipProcessor"""],
}

try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __A							:							List[Any]  							=		["""BlipImageProcessor"""]


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __A							:							List[str]  							=		[
     """BLIP_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """BlipModel""",
     """BlipPreTrainedModel""",
     """BlipForConditionalGeneration""",
     """BlipForQuestionAnswering""",
     """BlipVisionModel""",
     """BlipTextModel""",
     """BlipForImageTextRetrieval""",
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __A							:							List[Any]  							=		[
     """TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """TFBlipModel""",
     """TFBlipPreTrainedModel""",
     """TFBlipForConditionalGeneration""",
     """TFBlipForQuestionAnswering""",
     """TFBlipVisionModel""",
     """TFBlipTextModel""",
     """TFBlipForImageTextRetrieval""",
 ]

if TYPE_CHECKING:
 from .configuration_blip import BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP, BlipConfig, BlipTextConfig, BlipVisionConfig
 from .processing_blip import BlipProcessor

 try:
  if not is_vision_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .image_processing_blip import BlipImageProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_blip import (
      BLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
      BlipForConditionalGeneration,
      BlipForImageTextRetrieval,
      BlipForQuestionAnswering,
      BlipModel,
      BlipPreTrainedModel,
      BlipTextModel,
      BlipVisionModel,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_blip import (
      TF_BLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFBlipForConditionalGeneration,
      TFBlipForImageTextRetrieval,
      TFBlipForQuestionAnswering,
      TFBlipModel,
      TFBlipPreTrainedModel,
      TFBlipTextModel,
      TFBlipVisionModel,
  )

else:
 import sys

 __A							:							Tuple  							=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)










'''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							:							Optional[Any]  							=		logging.get_logger(__name__)

__A							:							int  							=		{
    """google/vit-base-patch16-224""": """https://huggingface.co/vit-base-patch16-224/resolve/main/config.json""",
    # See all ViT models at https://huggingface.co/models?filter=vit
}
class 				lowercase       (							_lowerCamelCase      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							"vit"

    def __init__(					self     :     Optional[int]				,     __lowerCamelCase     :     Tuple=768				,     __lowerCamelCase     :     Tuple=12				,     __lowerCamelCase     :     Tuple=12				,     __lowerCamelCase     :     int=3072				,     __lowerCamelCase     :     Optional[Any]="gelu"				,     __lowerCamelCase     :     Optional[int]=0.0				,     __lowerCamelCase     :     Tuple=0.0				,     __lowerCamelCase     :     Optional[Any]=0.0_2				,     __lowerCamelCase     :     int=1E-12				,     __lowerCamelCase     :     Tuple=224				,     __lowerCamelCase     :     int=16				,     __lowerCamelCase     :     Optional[int]=3				,     __lowerCamelCase     :     List[str]=True				,     __lowerCamelCase     :     str=16				,     **__lowerCamelCase     :     Optional[int]				,     )							->							str:

     '''simple docstring'''




     super().__init__(**__lowerCamelCase     )

     lowerCamelCase__  =     hidden_size
     lowerCamelCase__  =     num_hidden_layers
     lowerCamelCase__  =     num_attention_heads
     lowerCamelCase__  =     intermediate_size
     lowerCamelCase__  =     hidden_act
     lowerCamelCase__  =     hidden_dropout_prob
     lowerCamelCase__  =     attention_probs_dropout_prob
     lowerCamelCase__  =     initializer_range
     lowerCamelCase__  =     layer_norm_eps
     lowerCamelCase__  =     image_size
     lowerCamelCase__  =     patch_size
     lowerCamelCase__  =     num_channels
     lowerCamelCase__  =     qkv_bias
     lowerCamelCase__  =     encoder_stride
class 				lowercase       (							_lowerCamelCase      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							version.parse("1.11"      )

    @property
    def    a__				(					self     :     Optional[int]     )							->							Mapping[str, Mapping[int, str]]:

     '''simple docstring'''




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




    @property
    def    a__				(					self     :     Optional[int]     )							->							float:

     '''simple docstring'''




     return 1E-4

