



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


_snake_case		=  logging.get_logger(__name__)

_snake_case		=  {
    "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):
							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,			__a=5_0265,			__a=1024,			__a=12,			__a=16,			__a=4096,			__a="gelu",			__a=512,			__a=0.1,			__a=0.0,			__a=0.0,			__a=2,			__a=0.02,			__a=0.0,			__a=True,			__a=False,			__a=True,			__a=True,			__a=1,			__a=0,			__a=2,			**__a,			):

														'''simple docstring'''

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

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

from ..utils import DummyObject, requires_backends




class    _UpperCamelCase      (						metaclass=_UpperCAmelCase ):


			"""simple docstring"""






			__a  : Dict			 =						['''keras_nlp''']





			def __init__(   self      ,   *lowerCAmelCase__      ,   **lowerCAmelCase__						)     ->					Tuple:

							'''simple docstring'''


							requires_backends(self      ,   ['''keras_nlp''']						)