





'''simple docstring'''




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


lowercase__       : Optional[int]         =       logging.get_logger(__name__)

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

          '''simple docstring'''






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

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




"""simple docstring"""






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


__snake_case				:  Tuple =       logging.get_logger(__name__)

__snake_case				:  Any =       {
    'facebook/xglm-564M': 'https://huggingface.co/facebook/xglm-564M/resolve/main/config.json',
    # See all XGLM models at https://huggingface.co/models?filter=xglm
}



class      A__  (    __SCREAMING_SNAKE_CASE				):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE        =      'xglm'
	SCREAMING_SNAKE_CASE        =      ['past_key_values']

	SCREAMING_SNAKE_CASE        =      {
	    'num_attention_heads': 'attention_heads',
	    'hidden_size': 'd_model',
	    'num_hidden_layers': 'num_layers',
	}

	def __init__(	self:						Optional[Any]			,     _SCREAMING_SNAKE_CASE:						List[Any]=25_6008			,     _SCREAMING_SNAKE_CASE:						Dict=2048			,     _SCREAMING_SNAKE_CASE:						int=1024			,     _SCREAMING_SNAKE_CASE:						Dict=4096			,     _SCREAMING_SNAKE_CASE:						Optional[Any]=24			,     _SCREAMING_SNAKE_CASE:						int=16			,     _SCREAMING_SNAKE_CASE:						List[str]="gelu"			,     _SCREAMING_SNAKE_CASE:						Optional[Any]=0.1			,     _SCREAMING_SNAKE_CASE:						int=0.1			,     _SCREAMING_SNAKE_CASE:						List[Any]=0.0			,     _SCREAMING_SNAKE_CASE:						Union[str, Any]=0.0			,     _SCREAMING_SNAKE_CASE:						Any=0.02			,     _SCREAMING_SNAKE_CASE:						Any=True			,     _SCREAMING_SNAKE_CASE:						Tuple=True			,     _SCREAMING_SNAKE_CASE:						Any=2			,     _SCREAMING_SNAKE_CASE:						str=1			,     _SCREAMING_SNAKE_CASE:						Dict=0			,     _SCREAMING_SNAKE_CASE:						Dict=2			,     **_SCREAMING_SNAKE_CASE:						List[Any]			,     )							->			List[str]:

				"""simple docstring"""

				__lowerCAmelCase :    Optional[int]				=			vocab_size
				__lowerCAmelCase :    int				=			max_position_embeddings
				__lowerCAmelCase :    Optional[Any]				=			d_model
				__lowerCAmelCase :    List[Any]				=			ffn_dim
				__lowerCAmelCase :    int				=			num_layers
				__lowerCAmelCase :    Any				=			attention_heads
				__lowerCAmelCase :    int				=			activation_function
				__lowerCAmelCase :    List[Any]				=			dropout
				__lowerCAmelCase :    Optional[int]				=			attention_dropout
				__lowerCAmelCase :    Optional[int]				=			activation_dropout
				__lowerCAmelCase :    Optional[int]				=			layerdrop
				__lowerCAmelCase :    Optional[int]				=			init_std
				__lowerCAmelCase :    Tuple				=			scale_embedding  # scale factor will be sqrt(d_model) if True
				__lowerCAmelCase :    Dict				=			use_cache

				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			,     )