





"""simple docstring"""






from typing import List

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


lowerCAmelCase_			=							logging.get_logger(__name__)

lowerCAmelCase_			=							{
    '''snap-research/efficientformer-l1-300''': (
        '''https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'''
    ),
}



class 	lowerCAmelCase					(      snake_case							):
       lowerCAmelCase__						 =  """efficientformer"""






       def __init__(   self    ,  a__ = [3, 2, 6, 4]    ,  a__ = [48, 96, 2_24, 4_48]    ,  a__ = [True, True, True, True]    ,  a__ = 4_48    ,  a__ = 32    ,  a__ = 4    ,  a__ = 7    ,  a__ = 5    ,  a__ = 8    ,  a__ = 4    ,  a__ = 0.0    ,  a__ = 16    ,  a__ = 3    ,  a__ = 3    ,  a__ = 3    ,  a__ = 2    ,  a__ = 1    ,  a__ = 0.0    ,  a__ = 1    ,  a__ = True    ,  a__ = True    ,  a__ = 1E-5    ,  a__ = "gelu"    ,  a__ = 0.02    ,  a__ = 1E-12    ,  a__ = 2_24    ,  a__ = 1E-05    ,  **a__    ,  ):
              super().__init__(**a__     )

              _UpperCAmelCase     =     hidden_act
              _UpperCAmelCase     =     hidden_dropout_prob
              _UpperCAmelCase     =     hidden_sizes
              _UpperCAmelCase     =     num_hidden_layers
              _UpperCAmelCase     =     num_attention_heads
              _UpperCAmelCase     =     initializer_range
              _UpperCAmelCase     =     layer_norm_eps
              _UpperCAmelCase     =     patch_size
              _UpperCAmelCase     =     num_channels
              _UpperCAmelCase     =     depths
              _UpperCAmelCase     =     mlp_expansion_ratio
              _UpperCAmelCase     =     downsamples
              _UpperCAmelCase     =     dim
              _UpperCAmelCase     =     key_dim
              _UpperCAmelCase     =     attention_ratio
              _UpperCAmelCase     =     resolution
              _UpperCAmelCase     =     pool_size
              _UpperCAmelCase     =     downsample_patch_size
              _UpperCAmelCase     =     downsample_stride
              _UpperCAmelCase     =     downsample_pad
              _UpperCAmelCase     =     drop_path_rate
              _UpperCAmelCase     =     num_metaad_blocks
              _UpperCAmelCase     =     distillation
              _UpperCAmelCase     =     use_layer_scale
              _UpperCAmelCase     =     layer_scale_init_value
              _UpperCAmelCase     =     image_size
              _UpperCAmelCase     =     batch_norm_eps













"""simple docstring"""






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


lowerCAmelCase_			=							logging.get_logger(__name__)

lowerCAmelCase_			=							{
    '''microsoft/trocr-base-handwritten''': (
        '''https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json'''
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}



class 	lowerCAmelCase					(      snake_case							):
       lowerCAmelCase__						 =  """trocr"""
       lowerCAmelCase__						 =  ["""past_key_values"""]
       lowerCAmelCase__						 =  {
           """num_attention_heads""": """decoder_attention_heads""",
           """hidden_size""": """d_model""",
           """num_hidden_layers""": """decoder_layers""",
       }






       def __init__(   self    ,  a__=5_02_65    ,  a__=10_24    ,  a__=12    ,  a__=16    ,  a__=40_96    ,  a__="gelu"    ,  a__=5_12    ,  a__=0.1    ,  a__=0.0    ,  a__=0.0    ,  a__=2    ,  a__=0.02    ,  a__=0.0    ,  a__=True    ,  a__=False    ,  a__=True    ,  a__=True    ,  a__=1    ,  a__=0    ,  a__=2    ,  **a__    ,  ):
              _UpperCAmelCase     =     vocab_size
              _UpperCAmelCase     =     d_model
              _UpperCAmelCase     =     decoder_layers
              _UpperCAmelCase     =     decoder_attention_heads
              _UpperCAmelCase     =     decoder_ffn_dim
              _UpperCAmelCase     =     activation_function
              _UpperCAmelCase     =     max_position_embeddings
              _UpperCAmelCase     =     dropout
              _UpperCAmelCase     =     attention_dropout
              _UpperCAmelCase     =     activation_dropout
              _UpperCAmelCase     =     init_std
              _UpperCAmelCase     =     decoder_layerdrop
              _UpperCAmelCase     =     use_cache
              _UpperCAmelCase     =     scale_embedding
              _UpperCAmelCase     =     use_learned_position_embeddings
              _UpperCAmelCase     =     layernorm_embedding

              super().__init__(
                  pad_token_id=a__    ,  bos_token_id=a__    ,  eos_token_id=a__    ,  decoder_start_token_id=a__    ,  **a__    ,  )






