



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


lowercase__		:    List[Any]				   =     logging.get_logger(__name__)

lowercase__		:    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 				UpperCamelCase__       (     lowercase_  ):




      """simple docstring"""




      _SCREAMING_SNAKE_CASE      =					"""beit"""



      def __init__(				self    :				List[Any]   ,      SCREAMING_SNAKE_CASE_    :				Any=8_1_9_2   ,      SCREAMING_SNAKE_CASE_    :				List[Any]=7_6_8   ,      SCREAMING_SNAKE_CASE_    :				Optional[int]=1_2   ,      SCREAMING_SNAKE_CASE_    :				List[str]=1_2   ,      SCREAMING_SNAKE_CASE_    :				Optional[Any]=3_0_7_2   ,      SCREAMING_SNAKE_CASE_    :				int="gelu"   ,      SCREAMING_SNAKE_CASE_    :				Any=0.0   ,      SCREAMING_SNAKE_CASE_    :				List[Any]=0.0   ,      SCREAMING_SNAKE_CASE_    :				Union[str, Any]=0.02   ,      SCREAMING_SNAKE_CASE_    :				Optional[Any]=1E-12   ,      SCREAMING_SNAKE_CASE_    :				List[Any]=2_2_4   ,      SCREAMING_SNAKE_CASE_    :				Tuple=1_6   ,      SCREAMING_SNAKE_CASE_    :				Union[str, Any]=3   ,      SCREAMING_SNAKE_CASE_    :				Dict=False   ,      SCREAMING_SNAKE_CASE_    :				Tuple=False   ,      SCREAMING_SNAKE_CASE_    :				int=False   ,      SCREAMING_SNAKE_CASE_    :				Any=False   ,      SCREAMING_SNAKE_CASE_    :				List[Any]=0.1   ,      SCREAMING_SNAKE_CASE_    :				Union[str, Any]=0.1   ,      SCREAMING_SNAKE_CASE_    :				str=True   ,      SCREAMING_SNAKE_CASE_    :				Any=[3, 5, 7, 1_1]   ,      SCREAMING_SNAKE_CASE_    :				Tuple=[1, 2, 3, 6]   ,      SCREAMING_SNAKE_CASE_    :				Dict=True   ,      SCREAMING_SNAKE_CASE_    :				Union[str, Any]=0.4   ,      SCREAMING_SNAKE_CASE_    :				int=2_5_6   ,      SCREAMING_SNAKE_CASE_    :				int=1   ,      SCREAMING_SNAKE_CASE_    :				str=False   ,      SCREAMING_SNAKE_CASE_    :				str=2_5_5   ,      **SCREAMING_SNAKE_CASE_    :				Optional[Any]   ,      ):
        super().__init__(**SCREAMING_SNAKE_CASE_	)

        lowerCAmelCase_       :    str								=			vocab_size
        lowerCAmelCase_       :    Tuple								=			hidden_size
        lowerCAmelCase_       :    Dict								=			num_hidden_layers
        lowerCAmelCase_       :    Any								=			num_attention_heads
        lowerCAmelCase_       :    Optional[int]								=			intermediate_size
        lowerCAmelCase_       :    Tuple								=			hidden_act
        lowerCAmelCase_       :    Optional[Any]								=			hidden_dropout_prob
        lowerCAmelCase_       :    int								=			attention_probs_dropout_prob
        lowerCAmelCase_       :    List[Any]								=			initializer_range
        lowerCAmelCase_       :    str								=			layer_norm_eps

        lowerCAmelCase_       :    Dict								=			image_size
        lowerCAmelCase_       :    List[str]								=			patch_size
        lowerCAmelCase_       :    Tuple								=			num_channels
        lowerCAmelCase_       :    int								=			use_mask_token
        lowerCAmelCase_       :    Optional[int]								=			use_absolute_position_embeddings
        lowerCAmelCase_       :    str								=			use_relative_position_bias
        lowerCAmelCase_       :    Dict								=			use_shared_relative_position_bias
        lowerCAmelCase_       :    Tuple								=			layer_scale_init_value
        lowerCAmelCase_       :    List[Any]								=			drop_path_rate
        lowerCAmelCase_       :    Union[str, Any]								=			use_mean_pooling
        # decode head attributes (semantic segmentation)
        lowerCAmelCase_       :    Any								=			out_indices
        lowerCAmelCase_       :    Union[str, Any]								=			pool_scales
        # auxiliary head attributes (semantic segmentation)
        lowerCAmelCase_       :    Dict								=			use_auxiliary_head
        lowerCAmelCase_       :    List[Any]								=			auxiliary_loss_weight
        lowerCAmelCase_       :    int								=			auxiliary_channels
        lowerCAmelCase_       :    List[Any]								=			auxiliary_num_convs
        lowerCAmelCase_       :    int								=			auxiliary_concat_input
        lowerCAmelCase_       :    List[str]								=			semantic_loss_ignore_index







class 				UpperCamelCase__       (     lowercase_  ):




      """simple docstring"""




      _SCREAMING_SNAKE_CASE      =					version.parse("""1.11"""  )



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





      @property
      def 					SCREAMING_SNAKE_CASE__			(				self    :				Optional[Any]	):
        return 1E-4










"""simple docstring"""







import os

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home


lowercase__		:    int				   =     HUGGINGFACE_HUB_CACHE


lowercase__		:    Tuple				   =     """config.json"""
lowercase__		:    Union[str, Any]				   =     """diffusion_pytorch_model.bin"""
lowercase__		:    List[Any]				   =     """diffusion_flax_model.msgpack"""
lowercase__		:    List[str]				   =     """model.onnx"""
lowercase__		:    List[Any]				   =     """diffusion_pytorch_model.safetensors"""
lowercase__		:    Dict				   =     """weights.pb"""
lowercase__		:    List[Any]				   =     """https://huggingface.co"""
lowercase__		:    List[Any]				   =     default_cache_path
lowercase__		:    Tuple				   =     """diffusers_modules"""
lowercase__		:    Tuple				   =     os.getenv("""HF_MODULES_CACHE""", os.path.join(hf_cache_home, """modules"""))
lowercase__		:    List[str]				   =     ["""fp16""", """non-ema"""]
lowercase__		:    Optional[Any]				   =     """.self_attn"""





