


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


__snake_case		=       logging.get_logger(__name__)

__snake_case		=       {
    '''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     __lowerCamelCase  (					a__				):

     '''simple docstring'''
     A_       :	Optional[int]    =		'vit'


     def __init__(      self    ,				__UpperCAmelCase=768    ,				__UpperCAmelCase=12    ,				__UpperCAmelCase=12    ,				__UpperCAmelCase=3072    ,				__UpperCAmelCase="gelu"    ,				__UpperCAmelCase=0.0    ,				__UpperCAmelCase=0.0    ,				__UpperCAmelCase=0.02    ,				__UpperCAmelCase=1e-1_2    ,				__UpperCAmelCase=224    ,				__UpperCAmelCase=16    ,				__UpperCAmelCase=3    ,				__UpperCAmelCase=True    ,				__UpperCAmelCase=16    ,				**__UpperCAmelCase    ,				)       ->							str:
          super().__init__(**__UpperCAmelCase							)

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







class     __lowerCamelCase  (					a__				):

     '''simple docstring'''
     A_       :	Dict    =		version.parse('1.11'				)


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





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



"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__snake_case		=       {
    '''configuration_pix2struct''': [
        '''PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''Pix2StructConfig''',
        '''Pix2StructTextConfig''',
        '''Pix2StructVisionConfig''',
    ],
    '''processing_pix2struct''': ['''Pix2StructProcessor'''],
}

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __snake_case		=       ['''Pix2StructImageProcessor''']


try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __snake_case		=       [
       '''PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''Pix2StructPreTrainedModel''',
       '''Pix2StructForConditionalGeneration''',
       '''Pix2StructVisionModel''',
       '''Pix2StructTextModel''',
   ]

if TYPE_CHECKING:
   from .configuration_pixastruct import (
       PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP,
       PixaStructConfig,
       PixaStructTextConfig,
       PixaStructVisionConfig,
   )
   from .processing_pixastruct import PixaStructProcessor

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .image_processing_pixastruct import PixaStructImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_pixastruct import (
          PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST,
          PixaStructForConditionalGeneration,
          PixaStructPreTrainedModel,
          PixaStructTextModel,
          PixaStructVisionModel,
      )

else:
   import sys

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