





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/data2vec-vision-base-ft": (
        "https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json"
    ),
}

class        __SCREAMING_SNAKE_CASE					(     _a       ):
							snake_case     :      Union[str, Any]						     =       """data2vec-vision"""






							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=False  , __lowerCAmelCase=False  , __lowerCAmelCase=False  , __lowerCAmelCase=False  , __lowerCAmelCase=0.1  , __lowerCAmelCase=0.1  , __lowerCAmelCase=True  , __lowerCAmelCase=[3, 5, 7, 11]  , __lowerCAmelCase=[1, 2, 3, 6]  , __lowerCAmelCase=True  , __lowerCAmelCase=0.4  , __lowerCAmelCase=256  , __lowerCAmelCase=1  , __lowerCAmelCase=False  , __lowerCAmelCase=255  , **__lowerCAmelCase  , ):
														super().__init__(**__lowerCAmelCase  )

														UpperCamelCase__				     =			hidden_size
														UpperCamelCase__				     =			num_hidden_layers
														UpperCamelCase__				     =			num_attention_heads
														UpperCamelCase__				     =			intermediate_size
														UpperCamelCase__				     =			hidden_act
														UpperCamelCase__				     =			hidden_dropout_prob
														UpperCamelCase__				     =			attention_probs_dropout_prob
														UpperCamelCase__				     =			initializer_range
														UpperCamelCase__				     =			layer_norm_eps

														UpperCamelCase__				     =			image_size
														UpperCamelCase__				     =			patch_size
														UpperCamelCase__				     =			num_channels
														UpperCamelCase__				     =			use_mask_token
														UpperCamelCase__				     =			use_absolute_position_embeddings
														UpperCamelCase__				     =			use_relative_position_bias
														UpperCamelCase__				     =			use_shared_relative_position_bias
														UpperCamelCase__				     =			layer_scale_init_value
														UpperCamelCase__				     =			drop_path_rate
														UpperCamelCase__				     =			use_mean_pooling
														# decode head attributes (semantic segmentation)
														UpperCamelCase__				     =			out_indices
														UpperCamelCase__				     =			pool_scales
														# auxiliary head attributes (semantic segmentation)
														UpperCamelCase__				     =			use_auxiliary_head
														UpperCamelCase__				     =			auxiliary_loss_weight
														UpperCamelCase__				     =			auxiliary_channels
														UpperCamelCase__				     =			auxiliary_num_convs
														UpperCamelCase__				     =			auxiliary_concat_input
														UpperCamelCase__				     =			semantic_loss_ignore_index






class        __SCREAMING_SNAKE_CASE					(     _a       ):
							snake_case     :      List[Any]						     =       version.parse("""1.11"""       )






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







							@property
							def 				_lowerCamelCase		(						self  ):
														return 1E-4











from typing import TYPE_CHECKING

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


UpperCamelCase__											= {
    "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:
					UpperCamelCase__											= ["Pix2StructImageProcessor"]


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

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




