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


__UpperCamelCase									=			logging.get_logger(__name__)

__UpperCamelCase									=			{
    '''facebook/deit-base-distilled-patch16-224''': (
        '''https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json'''
    ),
    # See all DeiT models at https://huggingface.co/models?filter=deit
}




class  UpperCamelCase					(				lowerCAmelCase__   ):
       SCREAMING_SNAKE_CASE_			=      "deit"







       def __init__( self,							lowerCAmelCase__=768,							lowerCAmelCase__=12,							lowerCAmelCase__=12,							lowerCAmelCase__=3072,							lowerCAmelCase__="gelu",							lowerCAmelCase__=0.0,							lowerCAmelCase__=0.0,							lowerCAmelCase__=0.02,							lowerCAmelCase__=1e-12,							lowerCAmelCase__=224,							lowerCAmelCase__=16,							lowerCAmelCase__=3,							lowerCAmelCase__=True,							lowerCAmelCase__=16,							**lowerCAmelCase__,							)      ->      List[Any]:
            super().__init__(**lowerCAmelCase__)

            snake_case_					       =					hidden_size
            snake_case_					       =					num_hidden_layers
            snake_case_					       =					num_attention_heads
            snake_case_					       =					intermediate_size
            snake_case_					       =					hidden_act
            snake_case_					       =					hidden_dropout_prob
            snake_case_					       =					attention_probs_dropout_prob
            snake_case_					       =					initializer_range
            snake_case_					       =					layer_norm_eps
            snake_case_					       =					image_size
            snake_case_					       =					patch_size
            snake_case_					       =					num_channels
            snake_case_					       =					qkv_bias
            snake_case_					       =					encoder_stride




class  UpperCamelCase					(				lowerCAmelCase__   ):
       SCREAMING_SNAKE_CASE_			=      version.parse("1.11"   )







       @property
       def 		a_						( self)      ->      Mapping[str, Mapping[int, str]]:
            return OrderedDict(
                [
                    ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
                ])







       @property
       def 		a_						( self)      ->      float:
            return 1e-4





"""simple docstring"""




from typing import TYPE_CHECKING

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


__UpperCamelCase						=      {
    '''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:
	__UpperCamelCase						=      ['''BlipImageProcessor''']


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

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

	__UpperCamelCase						=      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


