






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


__lowerCamelCase   :     List[str] 		= logging.get_logger(__name__)

__lowerCamelCase   :     Optional[Any] 		= {
    '''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 				SCREAMING_SNAKE_CASE__		(							UpperCamelCase_		):





					"""simple docstring"""






					a_      =						'beit'



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

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

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



class 				SCREAMING_SNAKE_CASE__		(							UpperCamelCase_		):





					"""simple docstring"""






					a_      =						version.parse("1.11"		)



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






					@property
					def 			_lowercase	(   self	:    str			):
						return 1e-4







from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


lowerCAmelCase__    :Any       =				logging.get_logger(__name__)

lowerCAmelCase__    :Union[str, Any]       =				{
    '''facebook/xmod-base''': '''https://huggingface.co/facebook/xmod-base/resolve/main/config.json''',
    '''facebook/xmod-large-prenorm''': '''https://huggingface.co/facebook/xmod-large-prenorm/resolve/main/config.json''',
    '''facebook/xmod-base-13-125k''': '''https://huggingface.co/facebook/xmod-base-13-125k/resolve/main/config.json''',
    '''facebook/xmod-base-30-125k''': '''https://huggingface.co/facebook/xmod-base-30-125k/resolve/main/config.json''',
    '''facebook/xmod-base-30-195k''': '''https://huggingface.co/facebook/xmod-base-30-195k/resolve/main/config.json''',
    '''facebook/xmod-base-60-125k''': '''https://huggingface.co/facebook/xmod-base-60-125k/resolve/main/config.json''',
    '''facebook/xmod-base-60-265k''': '''https://huggingface.co/facebook/xmod-base-60-265k/resolve/main/config.json''',
    '''facebook/xmod-base-75-125k''': '''https://huggingface.co/facebook/xmod-base-75-125k/resolve/main/config.json''',
    '''facebook/xmod-base-75-269k''': '''https://huggingface.co/facebook/xmod-base-75-269k/resolve/main/config.json''',
}

class 						__a (							UpperCAmelCase     ):
		_a      :    Any           =      'xmod'
		def __init__(     self     ,       _SCREAMING_SNAKE_CASE=30522     ,       _SCREAMING_SNAKE_CASE=768     ,       _SCREAMING_SNAKE_CASE=12     ,       _SCREAMING_SNAKE_CASE=12     ,       _SCREAMING_SNAKE_CASE=3072     ,       _SCREAMING_SNAKE_CASE="gelu"     ,       _SCREAMING_SNAKE_CASE=0.1     ,       _SCREAMING_SNAKE_CASE=0.1     ,       _SCREAMING_SNAKE_CASE=512     ,       _SCREAMING_SNAKE_CASE=2     ,       _SCREAMING_SNAKE_CASE=0.02     ,       _SCREAMING_SNAKE_CASE=1e-1_2     ,       _SCREAMING_SNAKE_CASE=1     ,       _SCREAMING_SNAKE_CASE=0     ,       _SCREAMING_SNAKE_CASE=2     ,       _SCREAMING_SNAKE_CASE="absolute"     ,       _SCREAMING_SNAKE_CASE=True     ,       _SCREAMING_SNAKE_CASE=None     ,       _SCREAMING_SNAKE_CASE=False     ,       _SCREAMING_SNAKE_CASE=2     ,       _SCREAMING_SNAKE_CASE=False     ,       _SCREAMING_SNAKE_CASE=True     ,       _SCREAMING_SNAKE_CASE=True     ,       _SCREAMING_SNAKE_CASE=("en_XX",)     ,       _SCREAMING_SNAKE_CASE=None     ,       **_SCREAMING_SNAKE_CASE     ,       )					->			Dict:




									"""simple docstring"""





									super().__init__(pad_token_id=_SCREAMING_SNAKE_CASE     ,       bos_token_id=_SCREAMING_SNAKE_CASE     ,       eos_token_id=_SCREAMING_SNAKE_CASE     ,       **_SCREAMING_SNAKE_CASE		)

									_UpperCAmelCase											=     vocab_size
									_UpperCAmelCase											=     hidden_size
									_UpperCAmelCase											=     num_hidden_layers
									_UpperCAmelCase											=     num_attention_heads
									_UpperCAmelCase											=     hidden_act
									_UpperCAmelCase											=     intermediate_size
									_UpperCAmelCase											=     hidden_dropout_prob
									_UpperCAmelCase											=     attention_probs_dropout_prob
									_UpperCAmelCase											=     max_position_embeddings
									_UpperCAmelCase											=     type_vocab_size
									_UpperCAmelCase											=     initializer_range
									_UpperCAmelCase											=     layer_norm_eps
									_UpperCAmelCase											=     position_embedding_type
									_UpperCAmelCase											=     use_cache
									_UpperCAmelCase											=     classifier_dropout
									_UpperCAmelCase											=     pre_norm
									_UpperCAmelCase											=     adapter_reduction_factor
									_UpperCAmelCase											=     adapter_layer_norm
									_UpperCAmelCase											=     adapter_reuse_layer_norm
									_UpperCAmelCase											=     ln_before_adapter
									_UpperCAmelCase											=     list(_SCREAMING_SNAKE_CASE		)
									_UpperCAmelCase											=     default_language



class 						__a (							UpperCAmelCase     ):
		@property
		def       UpperCAmelCase__							(     self		)					->			Mapping[str, Mapping[int, str]]:




									"""simple docstring"""





									if self.task == "multiple-choice":
																_UpperCAmelCase											=     {0: 'batch', 1: 'choice', 2: 'sequence'}
									else:
																_UpperCAmelCase											=     {0: 'batch', 1: 'sequence'}
									return OrderedDict(
									    [
									        ('input_ids', dynamic_axis),
									        ('attention_mask', dynamic_axis),
									    ]		)
