





'''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    (			UpperCAmelCase_							):


  '''simple docstring'''
  a_							:       Tuple      					="""trocr"""
  a_							:       List[Any]      					=["""past_key_values"""]
  a_							:       Any      					={
      """num_attention_heads""": """decoder_attention_heads""",
      """hidden_size""": """d_model""",
      """num_hidden_layers""": """decoder_layers""",
  }







  def __init__(      self      :					Union[str, Any]      ,				UpperCamelCase      :					Dict=5_02_65      ,				UpperCamelCase      :					Optional[int]=10_24      ,				UpperCamelCase      :					Optional[int]=12      ,				UpperCamelCase      :					Dict=16      ,				UpperCamelCase      :					int=40_96      ,				UpperCamelCase      :					Optional[Any]="gelu"      ,				UpperCamelCase      :					Optional[Any]=5_12      ,				UpperCamelCase      :					int=0.1      ,				UpperCamelCase      :					List[Any]=0.0      ,				UpperCamelCase      :					Union[str, Any]=0.0      ,				UpperCamelCase      :					Any=2      ,				UpperCamelCase      :					List[Any]=0.02      ,				UpperCamelCase      :					List[Any]=0.0      ,				UpperCamelCase      :					Optional[Any]=True      ,				UpperCamelCase      :					int=False      ,				UpperCamelCase      :					Optional[int]=True      ,				UpperCamelCase      :					List[Any]=True      ,				UpperCamelCase      :					List[str]=1      ,				UpperCamelCase      :					Union[str, Any]=0      ,				UpperCamelCase      :					Optional[int]=2      ,				**UpperCamelCase      :					Union[str, Any]      ,				):


    '''simple docstring'''





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

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











def     lowerCamelCase_	(      lowerCAmelCase:	int				)->		int:

  if not isinstance(lowerCAmelCase    ,							lowerCAmelCase				):
    _snake_case   :				Union[str, Any]														=	F"""Input value of [number={number}] must be an integer"""
    raise TypeError(lowerCAmelCase				)

  if number < 1:
    _snake_case   :				int														=	F"""Input value of [number={number}] must be > 0"""
    raise ValueError(lowerCAmelCase				)

  _snake_case   :				int														=	1

  for i in range(1    ,							lowerCAmelCase				):
    current_number *= 4 * i - 2
    current_number //= i + 1

  return current_number


if __name__ == "__main__":
      import doctest

      doctest.testmod()




