

"""simple docstring"""





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


__UpperCamelCase  :      List[str]							      =		logging.get_logger(__name__)

__UpperCamelCase  :      List[Any]							      =		{
    '''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 				SCREAMING_SNAKE_CASE					(		a_       ):






					"""simple docstring"""



					lowercase__				 =       "trocr"
					lowercase__				 =       ["past_key_values"]
					lowercase__				 =       {
					    "num_attention_heads": "decoder_attention_heads",
					    "hidden_size": "d_model",
					    "num_hidden_layers": "decoder_layers",
					}







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

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







"""simple docstring"""





from ..utils import DummyObject, requires_backends







class 				SCREAMING_SNAKE_CASE					(		metaclass=a_       ):






					"""simple docstring"""



					lowercase__				 =       ["speech"]







					def __init__(       self			:				Tuple   ,*lowercase_			:				Tuple   ,**lowercase_			:				List[str]		):
						requires_backends(self   ,['''speech''']		)







class 				SCREAMING_SNAKE_CASE					(		metaclass=a_       ):






					"""simple docstring"""



					lowercase__				 =       ["speech"]







					def __init__(       self			:				Union[str, Any]   ,*lowercase_			:				List[str]   ,**lowercase_			:				Any		):
						requires_backends(self   ,['''speech''']		)




