






from collections import OrderedDict
from typing import Mapping

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


A_						:						Optional[Any]						      =					logging.get_logger(__name__)

A_						:						Optional[Any]						      =					{
    'distilbert-base-uncased': 'https://huggingface.co/distilbert-base-uncased/resolve/main/config.json',
    'distilbert-base-uncased-distilled-squad': (
        'https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/config.json'
    ),
    'distilbert-base-cased': 'https://huggingface.co/distilbert-base-cased/resolve/main/config.json',
    'distilbert-base-cased-distilled-squad': (
        'https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/config.json'
    ),
    'distilbert-base-german-cased': 'https://huggingface.co/distilbert-base-german-cased/resolve/main/config.json',
    'distilbert-base-multilingual-cased': (
        'https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/config.json'
    ),
    'distilbert-base-uncased-finetuned-sst-2-english': (
        'https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english/resolve/main/config.json'
    ),
}




class 							_lowerCAmelCase(			UpperCAmelCase_   ):





       """simple docstring"""







       a							:						Dict										='''distilbert'''
       a							:						List[str]										={
           '''hidden_size''': '''dim''',
           '''num_attention_heads''': '''n_heads''',
           '''num_hidden_layers''': '''n_layers''',
       }





       def __init__(   self    ,     _lowerCamelCase=3_0_5_2_2    ,     _lowerCamelCase=5_1_2    ,     _lowerCamelCase=False    ,     _lowerCamelCase=6    ,     _lowerCamelCase=1_2    ,     _lowerCamelCase=7_6_8    ,     _lowerCamelCase=4 * 7_6_8    ,     _lowerCamelCase=0.1    ,     _lowerCamelCase=0.1    ,     _lowerCamelCase="gelu"    ,     _lowerCamelCase=0.0_2    ,     _lowerCamelCase=0.1    ,     _lowerCamelCase=0.2    ,     _lowerCamelCase=0    ,     **_lowerCamelCase    ,     ):
         UpperCamelCase_:   Tuple        =							vocab_size
         UpperCamelCase_:   str        =							max_position_embeddings
         UpperCamelCase_:   Optional[int]        =							sinusoidal_pos_embds
         UpperCamelCase_:   Union[str, Any]        =							n_layers
         UpperCamelCase_:   Optional[int]        =							n_heads
         UpperCamelCase_:   int        =							dim
         UpperCamelCase_:   Tuple        =							hidden_dim
         UpperCamelCase_:   Any        =							dropout
         UpperCamelCase_:   Optional[Any]        =							attention_dropout
         UpperCamelCase_:   List[str]        =							activation
         UpperCamelCase_:   Optional[Any]        =							initializer_range
         UpperCamelCase_:   Optional[Any]        =							qa_dropout
         UpperCamelCase_:   List[str]        =							seq_classif_dropout
         super().__init__(**_lowerCamelCase    ,     pad_token_id=_lowerCamelCase				)







class 							_lowerCAmelCase(			UpperCAmelCase_   ):





       """simple docstring"""







       @property
       def      _a       (   self				):
         if self.task == "multiple-choice":
           UpperCamelCase_:   Any        =							{0: 'batch', 1: 'choice', 2: 'sequence'}
         else:
           UpperCamelCase_:   List[Any]        =							{0: 'batch', 1: 'sequence'}
         return OrderedDict(
             [
                 ('input_ids', dynamic_axis),
                 ('attention_mask', dynamic_axis),
             ]				)


"""simple docstring"""

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_UpperCamelCase		     =    logging.get_logger(__name__)

_UpperCamelCase		     =    {
    """microsoft/focalnet-tiny""": """https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json""",
}






class 			__a					(						__magic_name__       ,	__magic_name__       ):





       """simple docstring"""


       __UpperCamelCase					:      Optional[Any]    =						'focalnet'






       def __init__(   self			,					snake_case=224			,					snake_case=4			,					snake_case=3			,					snake_case=96			,					snake_case=False			,					snake_case=[192, 384, 768, 768]			,					snake_case=[2, 2, 6, 2]			,					snake_case=[2, 2, 2, 2]			,					snake_case=[3, 3, 3, 3]			,					snake_case="gelu"			,					snake_case=4.0			,					snake_case=0.0			,					snake_case=0.1			,					snake_case=False			,					snake_case=1e-4			,					snake_case=False			,					snake_case=False			,					snake_case=False			,					snake_case=0.02			,					snake_case=1e-5			,					snake_case=32			,					snake_case=None			,					snake_case=None			,					**snake_case			,					):





        """simple docstring"""

        super().__init__(**snake_case   )

        lowerCAmelCase__   :				Optional[Any] 			=				image_size
        lowerCAmelCase__   :				Union[str, Any] 			=				patch_size
        lowerCAmelCase__   :				List[str] 			=				num_channels
        lowerCAmelCase__   :				List[str] 			=				embed_dim
        lowerCAmelCase__   :				List[Any] 			=				use_conv_embed
        lowerCAmelCase__   :				List[str] 			=				hidden_sizes
        lowerCAmelCase__   :				List[Any] 			=				depths
        lowerCAmelCase__   :				Union[str, Any] 			=				focal_levels
        lowerCAmelCase__   :				Union[str, Any] 			=				focal_windows
        lowerCAmelCase__   :				int 			=				hidden_act
        lowerCAmelCase__   :				List[Any] 			=				mlp_ratio
        lowerCAmelCase__   :				str 			=				hidden_dropout_prob
        lowerCAmelCase__   :				Union[str, Any] 			=				drop_path_rate
        lowerCAmelCase__   :				Tuple 			=				use_layerscale
        lowerCAmelCase__   :				Tuple 			=				layerscale_value
        lowerCAmelCase__   :				str 			=				use_post_layernorm
        lowerCAmelCase__   :				str 			=				use_post_layernorm_in_modulation
        lowerCAmelCase__   :				Union[str, Any] 			=				normalize_modulator
        lowerCAmelCase__   :				Optional[int] 			=				initializer_range
        lowerCAmelCase__   :				List[Any] 			=				layer_norm_eps
        lowerCAmelCase__   :				str 			=				encoder_stride
        lowerCAmelCase__   :				Union[str, Any] 			=				["stem"] + [F"""stage{idx}""" for idx in range(1			,					len(self.depths   ) + 1   )]
        lowerCAmelCase__			,						lowerCAmelCase__   :				Union[str, Any] 			=				get_aligned_output_features_output_indices(
            out_features=snake_case			,					out_indices=snake_case			,					stage_names=self.stage_names   )






