


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


__UpperCamelCase				:  Union[str, Any]      					=							logging.get_logger(__name__)

__UpperCamelCase				:  Optional[int]      					=							{
    '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  lowerCAmelCase__(    snake_case__						):






    '''simple docstring'''





    A_  :     int			= 'donut-swin'

    A_  :     Optional[Any]			= {
        'num_attention_heads': 'num_heads',
        'num_hidden_layers': 'num_layers',
    }





    def __init__(	self				:   Optional[int]       ,   __snake_case				:   str=224       ,   __snake_case				:   Optional[int]=4       ,   __snake_case				:   Optional[int]=3       ,   __snake_case				:   Optional[Any]=96       ,   __snake_case				:   Optional[Any]=[2, 2, 6, 2]       ,   __snake_case				:   int=[3, 6, 12, 24]       ,   __snake_case				:   int=7       ,   __snake_case				:   Union[str, Any]=4.0       ,   __snake_case				:   int=True       ,   __snake_case				:   int=0.0       ,   __snake_case				:   List[Any]=0.0       ,   __snake_case				:   List[Any]=0.1       ,   __snake_case				:   List[str]="gelu"       ,   __snake_case				:   int=False       ,   __snake_case				:   Optional[int]=0.02       ,   __snake_case				:   int=1E-5       ,   **__snake_case				:   Union[str, Any]       ,   ):





       '''simple docstring'''
       super().__init__(**__snake_case	)

       UpperCAmelCase_							:      Optional[Any]						=   image_size
       UpperCAmelCase_							:      Dict						=   patch_size
       UpperCAmelCase_							:      Optional[Any]						=   num_channels
       UpperCAmelCase_							:      Union[str, Any]						=   embed_dim
       UpperCAmelCase_							:      Any						=   depths
       UpperCAmelCase_							:      Union[str, Any]						=   len(__snake_case	)
       UpperCAmelCase_							:      Union[str, Any]						=   num_heads
       UpperCAmelCase_							:      List[str]						=   window_size
       UpperCAmelCase_							:      Dict						=   mlp_ratio
       UpperCAmelCase_							:      Tuple						=   qkv_bias
       UpperCAmelCase_							:      int						=   hidden_dropout_prob
       UpperCAmelCase_							:      Tuple						=   attention_probs_dropout_prob
       UpperCAmelCase_							:      Dict						=   drop_path_rate
       UpperCAmelCase_							:      Any						=   hidden_act
       UpperCAmelCase_							:      Union[str, Any]						=   use_absolute_embeddings
       UpperCAmelCase_							:      List[Any]						=   layer_norm_eps
       UpperCAmelCase_							:      Tuple						=   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						=   int(embed_dim * 2 ** (len(__snake_case	) - 1)	)



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


__UpperCamelCase				:  Any      					=							logging.get_logger(__name__)

__UpperCamelCase				:  Dict      					=							{
    'bigcode/gpt_bigcode-santacoder': 'https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json',
}





class  lowerCAmelCase__(    snake_case__						):






    '''simple docstring'''





    A_  :     List[str]			= 'gpt_bigcode'
    A_  :     Optional[Any]			= ['past_key_values']
    A_  :     Optional[int]			= {
        'hidden_size': 'n_embd',
        'max_position_embeddings': 'n_positions',
        'num_attention_heads': 'n_head',
        'num_hidden_layers': 'n_layer',
    }





    def __init__(	self				:   int       ,   __snake_case				:   Dict=50_257       ,   __snake_case				:   List[str]=1_024       ,   __snake_case				:   Dict=768       ,   __snake_case				:   Optional[int]=12       ,   __snake_case				:   str=12       ,   __snake_case				:   List[str]=None       ,   __snake_case				:   List[str]="gelu_pytorch_tanh"       ,   __snake_case				:   Optional[Any]=0.1       ,   __snake_case				:   str=0.1       ,   __snake_case				:   Optional[Any]=0.1       ,   __snake_case				:   List[str]=1E-5       ,   __snake_case				:   Dict=0.02       ,   __snake_case				:   Optional[int]=True       ,   __snake_case				:   Tuple=True       ,   __snake_case				:   Optional[Any]=50_256       ,   __snake_case				:   Optional[Any]=50_256       ,   __snake_case				:   Optional[Any]=True       ,   __snake_case				:   Optional[Any]=True       ,   __snake_case				:   List[Any]=True       ,   **__snake_case				:   List[str]       ,   ):





       '''simple docstring'''
       UpperCAmelCase_							:      Any						=   vocab_size
       UpperCAmelCase_							:      int						=   n_positions
       UpperCAmelCase_							:      Any						=   n_embd
       UpperCAmelCase_							:      Union[str, Any]						=   n_layer
       UpperCAmelCase_							:      List[str]						=   n_head
       UpperCAmelCase_							:      List[Any]						=   n_inner
       UpperCAmelCase_							:      Optional[int]						=   activation_function
       UpperCAmelCase_							:      str						=   resid_pdrop
       UpperCAmelCase_							:      Optional[Any]						=   embd_pdrop
       UpperCAmelCase_							:      str						=   attn_pdrop
       UpperCAmelCase_							:      Any						=   layer_norm_epsilon
       UpperCAmelCase_							:      List[str]						=   initializer_range
       UpperCAmelCase_							:      Optional[int]						=   scale_attn_weights
       UpperCAmelCase_							:      Union[str, Any]						=   use_cache
       UpperCAmelCase_							:      Dict						=   attention_softmax_in_fpaa
       UpperCAmelCase_							:      Union[str, Any]						=   scale_attention_softmax_in_fpaa
       UpperCAmelCase_							:      Optional[int]						=   multi_query

       UpperCAmelCase_							:      Optional[Any]						=   bos_token_id
       UpperCAmelCase_							:      Tuple						=   eos_token_id

       super().__init__(bos_token_id=__snake_case       ,   eos_token_id=__snake_case       ,   **__snake_case	)