






'''simple docstring'''



from collections import OrderedDict
from typing import Mapping

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


SCREAMING_SNAKE_CASE							=						logging.get_logger(__name__)

SCREAMING_SNAKE_CASE							=						{
    '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 UpperCAmelCase_       (     __A					):




      """simple docstring"""




      UpperCamelCase_             =      '''distilbert'''
      UpperCamelCase_             =      {
          '''hidden_size''': '''dim''',
          '''num_attention_heads''': '''n_heads''',
          '''num_hidden_layers''': '''n_layers''',
      }






      def __init__(			self      :		Optional[int]  ,   UpperCAmelCase      :		str=3_0522  ,   UpperCAmelCase      :		Any=512  ,   UpperCAmelCase      :		int=False  ,   UpperCAmelCase      :		List[str]=6  ,   UpperCAmelCase      :		Optional[int]=12  ,   UpperCAmelCase      :		Dict=768  ,   UpperCAmelCase      :		str=4 * 768  ,   UpperCAmelCase      :		int=0.1  ,   UpperCAmelCase      :		Optional[int]=0.1  ,   UpperCAmelCase      :		List[Any]="gelu"  ,   UpperCAmelCase      :		List[Any]=0.0_2  ,   UpperCAmelCase      :		List[Any]=0.1  ,   UpperCAmelCase      :		Optional[int]=0.2  ,   UpperCAmelCase      :		List[Any]=0  ,   **UpperCAmelCase      :		Dict  ,   )	->	str:


       '''simple docstring'''

       lowercase       : Dict						=vocab_size
       lowercase       : Union[str, Any]						=max_position_embeddings
       lowercase       : Any						=sinusoidal_pos_embds
       lowercase       : Dict						=n_layers
       lowercase       : Optional[int]						=n_heads
       lowercase       : Optional[Any]						=dim
       lowercase       : Any						=hidden_dim
       lowercase       : Optional[int]						=dropout
       lowercase       : str						=attention_dropout
       lowercase       : Any						=activation
       lowercase       : Optional[Any]						=initializer_range
       lowercase       : Optional[int]						=qa_dropout
       lowercase       : Optional[Any]						=seq_classif_dropout
       super().__init__(**UpperCAmelCase  ,   pad_token_id=UpperCAmelCase		)





class UpperCAmelCase_       (     __A					):




      """simple docstring"""




      @property
      def 					A__   (			self      :		Tuple		)	->	Mapping[str, Mapping[int, str]]:


       '''simple docstring'''

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










from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCamelCase_												=	logging.get_logger(__name__)

UpperCamelCase_												=	{
    'naver-clova-ix/donut-base': 'https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json',
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}

class     snake_case_		(   a							):






 '''simple docstring'''





 __UpperCamelCase       =      'donut-swin'

 __UpperCamelCase       =      {
     'num_attention_heads': 'num_heads',
     'num_hidden_layers': 'num_layers',
 }

 def __init__(  self,		A_=224,		A_=4,		A_=3,		A_=96,		A_=[2, 2, 6, 2],		A_=[3, 6, 12, 24],		A_=7,		A_=4.0,		A_=True,		A_=0.0,		A_=0.0,		A_=0.1,		A_="gelu",		A_=False,		A_=0.02,		A_=1E-5,		**A_,		)	->       List[str]:
    super().__init__(**A_		)

    UpperCAmelCase__						=image_size
    UpperCAmelCase__						=patch_size
    UpperCAmelCase__						=num_channels
    UpperCAmelCase__						=embed_dim
    UpperCAmelCase__						=depths
    UpperCAmelCase__						=len(A_		)
    UpperCAmelCase__						=num_heads
    UpperCAmelCase__						=window_size
    UpperCAmelCase__						=mlp_ratio
    UpperCAmelCase__						=qkv_bias
    UpperCAmelCase__						=hidden_dropout_prob
    UpperCAmelCase__						=attention_probs_dropout_prob
    UpperCAmelCase__						=drop_path_rate
    UpperCAmelCase__						=hidden_act
    UpperCAmelCase__						=use_absolute_embeddings
    UpperCAmelCase__						=layer_norm_eps
    UpperCAmelCase__						=initializer_range
    # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
    # this indicates the channel dimension after the last stage of the model
    UpperCAmelCase__						=int(embed_dim * 2 ** (len(A_		) - 1)		)



