



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


__SCREAMING_SNAKE_CASE           =  logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE           =  {
    """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 	lowerCamelCase_    ( _A						):






						'''simple docstring'''
						a__   =  "beit"







						def __init__(	self      :			Dict	,	__lowerCamelCase      :			List[str]=81_92	,	__lowerCamelCase      :			List[Any]=7_68	,	__lowerCamelCase      :			int=12	,	__lowerCamelCase      :			Tuple=12	,	__lowerCamelCase      :			Optional[Any]=30_72	,	__lowerCamelCase      :			Optional[Any]="gelu"	,	__lowerCamelCase      :			Tuple=0.0	,	__lowerCamelCase      :			Dict=0.0	,	__lowerCamelCase      :			Optional[int]=0.02	,	__lowerCamelCase      :			int=1e-12	,	__lowerCamelCase      :			List[str]=2_24	,	__lowerCamelCase      :			str=16	,	__lowerCamelCase      :			Optional[int]=3	,	__lowerCamelCase      :			Dict=False	,	__lowerCamelCase      :			Union[str, Any]=False	,	__lowerCamelCase      :			Optional[Any]=False	,	__lowerCamelCase      :			Any=False	,	__lowerCamelCase      :			str=0.1	,	__lowerCamelCase      :			str=0.1	,	__lowerCamelCase      :			int=True	,	__lowerCamelCase      :			Any=[3, 5, 7, 11]	,	__lowerCamelCase      :			Optional[int]=[1, 2, 3, 6]	,	__lowerCamelCase      :			Dict=True	,	__lowerCamelCase      :			Dict=0.4	,	__lowerCamelCase      :			List[str]=2_56	,	__lowerCamelCase      :			Optional[Any]=1	,	__lowerCamelCase      :			List[Any]=False	,	__lowerCamelCase      :			Any=2_55	,	**__lowerCamelCase      :			Union[str, Any]	,	)      ->				Optional[Any]:
									super().__init__(**__lowerCamelCase )

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

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







class 	lowerCamelCase_    ( _A						):






						'''simple docstring'''
						a__   =  version.parse("1.11"						)







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







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




from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Features, Sequence, Value
from .base import TaskTemplate

@dataclass(frozen=_A						)
class 	lowerCamelCase_    ( _A						):






						'''simple docstring'''
						# `task` is not a ClassVar since we want it to be part of the `asdict` output for JSON serialization
						a__   =  field(default="question-answering-extractive"						,metadata={"include_in_asdict_even_if_is_default": True}						)
						a__   =  Features({"question": Value("string"						), "context": Value("string"						)}						)
						a__   =  Features(
						    {
						        "answers": Sequence(
						            {
						                "text": Value("string"						),
						                "answer_start": Value("int32"						),
						            }						)
						    }						)
						a__   =  "question"
						a__   =  "context"
						a__   =  "answers"







						@property
						def 			SCREAMING_SNAKE_CASE__		(	self      :			Union[str, Any] )      ->				Dict[str, str]:
									return {self.question_column: "question", self.context_column: "context", self.answers_column: "answers"}