

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


a		=logging.get_logger(__name__)

a		={
    """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_		(       SCREAMING_SNAKE_CASE				):
							_UpperCAmelCase    :  Tuple						      =      '''trocr'''
							_UpperCAmelCase    :  int						      =      ['''past_key_values''']
							_UpperCAmelCase    :  Any						      =      {
							    '''num_attention_heads''': '''decoder_attention_heads''',
							    '''hidden_size''': '''d_model''',
							    '''num_hidden_layers''': '''decoder_layers''',
							}
							def __init__(		self		:			Optional[Any]   ,SCREAMING_SNAKE_CASE__		:			str=5_0_2_6_5   ,SCREAMING_SNAKE_CASE__		:			int=1_0_2_4   ,SCREAMING_SNAKE_CASE__		:			List[str]=1_2   ,SCREAMING_SNAKE_CASE__		:			str=1_6   ,SCREAMING_SNAKE_CASE__		:			Union[str, Any]=4_0_9_6   ,SCREAMING_SNAKE_CASE__		:			str="gelu"   ,SCREAMING_SNAKE_CASE__		:			Optional[int]=5_1_2   ,SCREAMING_SNAKE_CASE__		:			Tuple=0.1   ,SCREAMING_SNAKE_CASE__		:			Tuple=0.0   ,SCREAMING_SNAKE_CASE__		:			str=0.0   ,SCREAMING_SNAKE_CASE__		:			Any=2   ,SCREAMING_SNAKE_CASE__		:			Any=0.02   ,SCREAMING_SNAKE_CASE__		:			Tuple=0.0   ,SCREAMING_SNAKE_CASE__		:			List[str]=True   ,SCREAMING_SNAKE_CASE__		:			Any=False   ,SCREAMING_SNAKE_CASE__		:			List[str]=True   ,SCREAMING_SNAKE_CASE__		:			str=True   ,SCREAMING_SNAKE_CASE__		:			int=1   ,SCREAMING_SNAKE_CASE__		:			str=0   ,SCREAMING_SNAKE_CASE__		:			List[str]=2   ,**SCREAMING_SNAKE_CASE__		:			int   ,):
								__lowerCamelCase				:				Optional[Any]					       = vocab_size
								__lowerCamelCase				:				Dict					       = d_model
								__lowerCamelCase				:				Union[str, Any]					       = decoder_layers
								__lowerCamelCase				:				Optional[int]					       = decoder_attention_heads
								__lowerCamelCase				:				str					       = decoder_ffn_dim
								__lowerCamelCase				:				Optional[Any]					       = activation_function
								__lowerCamelCase				:				List[Any]					       = max_position_embeddings
								__lowerCamelCase				:				Dict					       = dropout
								__lowerCamelCase				:				Any					       = attention_dropout
								__lowerCamelCase				:				List[str]					       = activation_dropout
								__lowerCamelCase				:				Optional[Any]					       = init_std
								__lowerCamelCase				:				Tuple					       = decoder_layerdrop
								__lowerCamelCase				:				Dict					       = use_cache
								__lowerCamelCase				:				Dict					       = scale_embedding
								__lowerCamelCase				:				List[str]					       = use_learned_position_embeddings
								__lowerCamelCase				:				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"""
def  lowerCamelCase_						(UpperCamelCase__		:		int     ,       UpperCamelCase__		:		int							):
    if a < 0 or b < 0:
        raise ValueError('''the value of both inputs must be positive'''							)
    _UpperCAmelCase							:  List[str]											=    str(bin(UpperCamelCase__							)							)[2:]  # remove the leading "0b"
    _UpperCAmelCase							:  str											=    str(bin(UpperCamelCase__							)							)[2:]
    _UpperCAmelCase							:  List[str]											=    max(len(UpperCamelCase__							)     ,       len(UpperCamelCase__							)							)
    return "0b" + "".join(
        str(int('''1''' in (char_a, char_b)							)							)
        for char_a, char_b in zip(a_binary.zfill(UpperCamelCase__							)     ,       b_binary.zfill(UpperCamelCase__							)							)							)


if __name__ == "__main__":
  import doctest

  doctest.testmod()


