


'''simple docstring'''







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


A__:    int					    =       logging.get_logger(__name__)

A__:    List[str]					    =       {
    '''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 A__       (						UpperCAmelCase__      ):
      __UpperCamelCase       :  Optional[int]	       =							"trocr"
      __UpperCamelCase       :  List[str]	       =							["past_key_values"]
      __UpperCamelCase       :  Optional[int]	       =							{
          "num_attention_heads": "decoder_attention_heads",
          "hidden_size": "d_model",
          "num_hidden_layers": "decoder_layers",
      }






      def __init__( self			:List[str]     ,						SCREAMING_SNAKE_CASE			:Tuple=5_0_2_6_5     ,						SCREAMING_SNAKE_CASE			:List[str]=1_0_2_4     ,						SCREAMING_SNAKE_CASE			:Optional[int]=1_2     ,						SCREAMING_SNAKE_CASE			:Any=1_6     ,						SCREAMING_SNAKE_CASE			:int=4_0_9_6     ,						SCREAMING_SNAKE_CASE			:Optional[int]="gelu"     ,						SCREAMING_SNAKE_CASE			:Tuple=5_1_2     ,						SCREAMING_SNAKE_CASE			:Tuple=0.1     ,						SCREAMING_SNAKE_CASE			:Optional[Any]=0.0     ,						SCREAMING_SNAKE_CASE			:Dict=0.0     ,						SCREAMING_SNAKE_CASE			:str=2     ,						SCREAMING_SNAKE_CASE			:Tuple=0.02     ,						SCREAMING_SNAKE_CASE			:Tuple=0.0     ,						SCREAMING_SNAKE_CASE			:List[str]=True     ,						SCREAMING_SNAKE_CASE			:Union[str, Any]=False     ,						SCREAMING_SNAKE_CASE			:Any=True     ,						SCREAMING_SNAKE_CASE			:List[Any]=True     ,						SCREAMING_SNAKE_CASE			:Dict=1     ,						SCREAMING_SNAKE_CASE			:Any=0     ,						SCREAMING_SNAKE_CASE			:Optional[Any]=2     ,						**SCREAMING_SNAKE_CASE			:Any     ,						)       ->					Tuple:




             '''simple docstring'''
             _a    : Optional[Any]     					=vocab_size
             _a    : Tuple     					=d_model
             _a    : int     					=decoder_layers
             _a    : str     					=decoder_attention_heads
             _a    : Union[str, Any]     					=decoder_ffn_dim
             _a    : Union[str, Any]     					=activation_function
             _a    : Any     					=max_position_embeddings
             _a    : Any     					=dropout
             _a    : Any     					=attention_dropout
             _a    : List[Any]     					=activation_dropout
             _a    : Union[str, Any]     					=init_std
             _a    : Optional[int]     					=decoder_layerdrop
             _a    : Optional[int]     					=use_cache
             _a    : Optional[int]     					=scale_embedding
             _a    : List[Any]     					=use_learned_position_embeddings
             _a    : int     					=layernorm_embedding

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






'''simple docstring'''







A__:    Optional[int]					    =       [4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A__:    Any					    =       [3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A__:    int					    =       {
    0: '''Sunday''',
    1: '''Monday''',
    2: '''Tuesday''',
    3: '''Wednesday''',
    4: '''Thursday''',
    5: '''Friday''',
    6: '''Saturday''',
}


def 	SCREAMING_SNAKE_CASE_					(  _UpperCAmelCase	:	int    ,_UpperCAmelCase	:	int    ,_UpperCAmelCase	:	int  )  ->			str:
       assert len(str(_UpperCAmelCase  )  ) > 2, "year should be in YYYY format"
       assert 1 <= month <= 12, "month should be between 1 to 12"
       assert 1 <= day <= 31, "day should be between 1 to 31"

       # Doomsday algorithm:
       _a    : List[str]     					=year // 100
       _a    : List[str]     					=(5 * (century % 4) + 2) % 7
       _a    : Optional[int]     					=year % 100
       _a    : Any     					=centurian % 12
       _a    : int     					=(
           (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
       ) % 7
       _a    : Optional[Any]     					=(
           DOOMSDAY_NOT_LEAP[month - 1]
           if (year % 4 != 0) or (centurian == 0 and (year % 400) == 0)
           else DOOMSDAY_LEAP[month - 1]
       )
       _a    : str     					=(dooms_day + day - day_anchor) % 7
       return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
   import doctest

   doctest.testmod()


