
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_		:     List[str]        =     logging.get_logger(__name__)

A_		:     Dict        =     {
    '''facebook/levit-128S''': '''https://huggingface.co/facebook/levit-128S/resolve/main/config.json''',
    # See all LeViT models at https://huggingface.co/models?filter=levit
}



class 		_lowercase		(       UpperCAmelCase__	):
   _UpperCAmelCase     	=			'''levit'''

   def __init__(      self			:       str							,   __lowerCAmelCase			:       List[str]=224							,   __lowerCAmelCase			:       int=3							,   __lowerCAmelCase			:       List[Any]=3							,   __lowerCAmelCase			:       List[str]=2							,   __lowerCAmelCase			:       List[str]=1							,   __lowerCAmelCase			:       Union[str, Any]=16							,   __lowerCAmelCase			:       Tuple=[128, 256, 384]							,   __lowerCAmelCase			:       Union[str, Any]=[4, 8, 12]							,   __lowerCAmelCase			:       List[str]=[4, 4, 4]							,   __lowerCAmelCase			:       Any=[16, 16, 16]							,   __lowerCAmelCase			:       Tuple=0							,   __lowerCAmelCase			:       Any=[2, 2, 2]							,   __lowerCAmelCase			:       Tuple=[2, 2, 2]							,   __lowerCAmelCase			:       Dict=0.0_2							,   **__lowerCAmelCase			:       int							,   )       ->				Dict:


    """simple docstring"""






    super().__init__(**__lowerCAmelCase							)
    a						=		image_size
    a						=		num_channels
    a						=		kernel_size
    a						=		stride
    a						=		padding
    a						=		hidden_sizes
    a						=		num_attention_heads
    a						=		depths
    a						=		key_dim
    a						=		drop_path_rate
    a						=		patch_size
    a						=		attention_ratio
    a						=		mlp_ratio
    a						=		initializer_range
    a						=		[
        ["Subsample", key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
        ["Subsample", key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
    ]



class 		_lowercase		(       UpperCAmelCase__	):
   _UpperCAmelCase     	=			version.parse('''1.11'''	)

   @property
   def 		A							(      self			:       Tuple							)       ->				Mapping[str, Mapping[int, str]]:


    """simple docstring"""






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




   @property
   def 		A							(      self			:       str							)       ->				float:


    """simple docstring"""






    return 1E-4






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A_		:     Optional[int]        =     {
    '''configuration_instructblip''': [
        '''INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''InstructBlipConfig''',
        '''InstructBlipQFormerConfig''',
        '''InstructBlipVisionConfig''',
    ],
    '''processing_instructblip''': ['''InstructBlipProcessor'''],
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     A_		:     List[Any]        =     [
         '''INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''InstructBlipQFormerModel''',
         '''InstructBlipPreTrainedModel''',
         '''InstructBlipForConditionalGeneration''',
         '''InstructBlipVisionModel''',
     ]

if TYPE_CHECKING:
     from .configuration_instructblip import (
         INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
         InstructBlipConfig,
         InstructBlipQFormerConfig,
         InstructBlipVisionConfig,
     )
     from .processing_instructblip import InstructBlipProcessor

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_instructblip import (
              INSTRUCTBLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
              InstructBlipForConditionalGeneration,
              InstructBlipPreTrainedModel,
              InstructBlipQFormerModel,
              InstructBlipVisionModel,
          )

else:
     import sys

     A_		:     Tuple        =     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

