






"""simple docstring"""

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


lowercase    			=       logging.get_logger(__name__)

lowercase    			=       {
    '''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_							(      lowercase__  ):
				UpperCAmelCase__        =				'trocr'
				UpperCAmelCase__        =				['past_key_values']
				UpperCAmelCase__        =				{
				    'num_attention_heads': 'decoder_attention_heads',
				    'hidden_size': 'd_model',
				    'num_hidden_layers': 'decoder_layers',
				}







				def __init__(							self							:						Union[str, Any]						,    __lowerCamelCase							:						Any=5_0_2_6_5						,    __lowerCamelCase							:						int=1_0_2_4						,    __lowerCamelCase							:						Any=1_2						,    __lowerCamelCase							:						List[Any]=1_6						,    __lowerCamelCase							:						List[str]=4_0_9_6						,    __lowerCamelCase							:						Union[str, Any]="gelu"						,    __lowerCamelCase							:						Any=5_1_2						,    __lowerCamelCase							:						Dict=0.1						,    __lowerCamelCase							:						Optional[int]=0.0						,    __lowerCamelCase							:						Optional[Any]=0.0						,    __lowerCamelCase							:						int=2						,    __lowerCamelCase							:						List[str]=0.02						,    __lowerCamelCase							:						Optional[int]=0.0						,    __lowerCamelCase							:						Optional[Any]=True						,    __lowerCamelCase							:						List[Any]=False						,    __lowerCamelCase							:						Optional[int]=True						,    __lowerCamelCase							:						Dict=True						,    __lowerCamelCase							:						int=1						,    __lowerCamelCase							:						Optional[int]=0						,    __lowerCamelCase							:						Optional[int]=2						,    **__lowerCamelCase							:						Union[str, Any]						,    )				->					Union[str, Any]:
										__magic_name__            =     vocab_size
										__magic_name__            =     d_model
										__magic_name__            =     decoder_layers
										__magic_name__            =     decoder_attention_heads
										__magic_name__            =     decoder_ffn_dim
										__magic_name__            =     activation_function
										__magic_name__            =     max_position_embeddings
										__magic_name__            =     dropout
										__magic_name__            =     attention_dropout
										__magic_name__            =     activation_dropout
										__magic_name__            =     init_std
										__magic_name__            =     decoder_layerdrop
										__magic_name__            =     use_cache
										__magic_name__            =     scale_embedding
										__magic_name__            =     use_learned_position_embeddings
										__magic_name__            =     layernorm_embedding

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











"""simple docstring"""

def _lowerCAmelCase	(  __lowerCamelCase:int   ):

						'''simple docstring'''






						if number < 0:
												raise ValueError("number must not be negative"   )
						return number & (number - 1) == 0


if __name__ == "__main__":
			import doctest

			doctest.testmod()



