



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





				'''simple docstring'''





				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  :  int  ,       _lowerCAmelCase  :  Any=5_0_2_6_5  ,       _lowerCAmelCase  :  Any=1_0_2_4  ,       _lowerCAmelCase  :  List[str]=1_2  ,       _lowerCAmelCase  :  str=1_6  ,       _lowerCAmelCase  :  List[Any]=4_0_9_6  ,       _lowerCAmelCase  :  Any="gelu"  ,       _lowerCAmelCase  :  Dict=5_1_2  ,       _lowerCAmelCase  :  Union[str, Any]=0.1  ,       _lowerCAmelCase  :  Union[str, Any]=0.0  ,       _lowerCAmelCase  :  List[Any]=0.0  ,       _lowerCAmelCase  :  List[str]=2  ,       _lowerCAmelCase  :  str=0.02  ,       _lowerCAmelCase  :  int=0.0  ,       _lowerCAmelCase  :  Any=True  ,       _lowerCAmelCase  :  List[str]=False  ,       _lowerCAmelCase  :  Any=True  ,       _lowerCAmelCase  :  Union[str, Any]=True  ,       _lowerCAmelCase  :  Optional[Any]=1  ,       _lowerCAmelCase  :  Tuple=0  ,       _lowerCAmelCase  :  Optional[int]=2  ,       **_lowerCAmelCase  :  Optional[int]  ,       ):







											'''simple docstring'''

											__lowercase       	=vocab_size
											__lowercase       	=d_model
											__lowercase       	=decoder_layers
											__lowercase       	=decoder_attention_heads
											__lowercase       	=decoder_ffn_dim
											__lowercase       	=activation_function
											__lowercase       	=max_position_embeddings
											__lowercase       	=dropout
											__lowercase       	=attention_dropout
											__lowercase       	=activation_dropout
											__lowercase       	=init_std
											__lowercase       	=decoder_layerdrop
											__lowercase       	=use_cache
											__lowercase       	=scale_embedding
											__lowercase       	=use_learned_position_embeddings
											__lowercase       	=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   _A       (   _lowerCAmelCase					):



							"""simple docstring"""



							if number > 0:
														raise ValueError('input must be a negative integer'					)
							__lowercase       	=len(bin(_lowerCAmelCase					)[3:]					)
							__lowercase       	=bin(abs(_lowerCAmelCase					) - (1 << binary_number_length)					)[3:]
							__lowercase       	=(
							    (
							        '1'
							        + '0' * (binary_number_length - len(_lowerCAmelCase					))
							        + twos_complement_number
							    )
							    if number < 0
							    else '0'
							)
							return "0b" + twos_complement_number


if __name__ == "__main__":
		import doctest

		doctest.testmod()



