






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

snake_case__      :	str       	=      {
    """microsoft/beit-base-patch16-224-pt22k""": (
        """https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json"""
    ),
    # See all BEiT models at https://huggingface.co/models?filter=beit
}


class 						_a       (  UpperCAmelCase__    ):






  """simple docstring"""





  A_						=   """beit"""




  def __init__(     self		,		_UpperCAmelCase=8192		,		_UpperCAmelCase=768		,		_UpperCAmelCase=12		,		_UpperCAmelCase=12		,		_UpperCAmelCase=3072		,		_UpperCAmelCase="gelu"		,		_UpperCAmelCase=0.0		,		_UpperCAmelCase=0.0		,		_UpperCAmelCase=0.0_2		,		_UpperCAmelCase=1e-12		,		_UpperCAmelCase=224		,		_UpperCAmelCase=16		,		_UpperCAmelCase=3		,		_UpperCAmelCase=False		,		_UpperCAmelCase=False		,		_UpperCAmelCase=False		,		_UpperCAmelCase=False		,		_UpperCAmelCase=0.1		,		_UpperCAmelCase=0.1		,		_UpperCAmelCase=True		,		_UpperCAmelCase=[3, 5, 7, 11]		,		_UpperCAmelCase=[1, 2, 3, 6]		,		_UpperCAmelCase=True		,		_UpperCAmelCase=0.4		,		_UpperCAmelCase=256		,		_UpperCAmelCase=1		,		_UpperCAmelCase=False		,		_UpperCAmelCase=255		,		**_UpperCAmelCase		,		)			-> Any:
     super().__init__(**_UpperCAmelCase )

     UpperCamelCase_									=     vocab_size
     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 						_a       (  UpperCAmelCase__    ):






  """simple docstring"""





  A_						=   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













from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
 if not (is_transformers_available() and is_torch_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from ...utils.dummy_torch_and_transformers_objects import (
     ImageTextPipelineOutput,
     UniDiffuserPipeline,
 )
else:
 from .modeling_text_decoder import UniDiffuserTextDecoder
 from .modeling_uvit import UniDiffuserModel, UTransformeraDModel
 from .pipeline_unidiffuser import ImageTextPipelineOutput, UniDiffuserPipeline





