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


lowercase    :   str		       =				logging.get_logger(__name__)

lowercase    :   int		       =				{
    """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 __snake_case						( SCREAMING_SNAKE_CASE_	):
    _a						:		str=							"trocr"
    _a						:		Dict=							["past_key_values"]
    _a						:		int=							{
        "num_attention_heads": "decoder_attention_heads",
        "hidden_size": "d_model",
        "num_hidden_layers": "decoder_layers",
    }
    def __init__(    self						,snake_case=50265						,snake_case=1024						,snake_case=12						,snake_case=16						,snake_case=4096						,snake_case="gelu"						,snake_case=512						,snake_case=0.1						,snake_case=0.0						,snake_case=0.0						,snake_case=2						,snake_case=0.02						,snake_case=0.0						,snake_case=True						,snake_case=False						,snake_case=True						,snake_case=True						,snake_case=1						,snake_case=0						,snake_case=2						,**snake_case						,):



           '''simple docstring'''







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

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





'''simple docstring'''





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


_UpperCamelCase											=		logging.get_logger(__name__)

_UpperCamelCase											=		{
    'google/pegasus-large': 'https://huggingface.co/google/pegasus-large/resolve/main/config.json',
    # See all PEGASUS models at https://huggingface.co/models?filter=pegasus
}






class    lowerCamelCase_       (							SCREAMING_SNAKE_CASE_	):
  """simple docstring"""




  a_				   ="""pegasus"""
  a_				   =["""past_key_values"""]
  a_				   ={"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}




  def __init__(					self :      Any     ,      _a :      int=5_0265     ,      _a :      Tuple=1024     ,      _a :      Optional[Any]=12     ,      _a :      int=4096     ,      _a :      str=16     ,      _a :      Union[str, Any]=12     ,      _a :      Optional[Any]=4096     ,      _a :      Optional[int]=16     ,      _a :      Union[str, Any]=0.0     ,      _a :      str=0.0     ,      _a :      List[Any]=True     ,      _a :      Optional[int]=True     ,      _a :      Tuple="gelu"     ,      _a :      Dict=1024     ,      _a :      int=0.1     ,      _a :      Any=0.0     ,      _a :      Union[str, Any]=0.0     ,      _a :      Any=0.02     ,      _a :      Optional[Any]=0     ,      _a :      str=False     ,      _a :      Tuple=0     ,      _a :      Optional[int]=1     ,      _a :      Union[str, Any]=1     ,      **_a :      Optional[int]     ,      )   ->   Any:
    __lowerCamelCase			:			Union[str, Any]       			=					vocab_size
    __lowerCamelCase			:			int       			=					max_position_embeddings
    __lowerCamelCase			:			Union[str, Any]       			=					d_model
    __lowerCamelCase			:			Union[str, Any]       			=					encoder_ffn_dim
    __lowerCamelCase			:			Union[str, Any]       			=					encoder_layers
    __lowerCamelCase			:			List[Any]       			=					encoder_attention_heads
    __lowerCamelCase			:			Optional[int]       			=					decoder_ffn_dim
    __lowerCamelCase			:			int       			=					decoder_layers
    __lowerCamelCase			:			Tuple       			=					decoder_attention_heads
    __lowerCamelCase			:			Optional[Any]       			=					dropout
    __lowerCamelCase			:			Tuple       			=					attention_dropout
    __lowerCamelCase			:			int       			=					activation_dropout
    __lowerCamelCase			:			Dict       			=					activation_function
    __lowerCamelCase			:			List[Any]       			=					init_std
    __lowerCamelCase			:			List[str]       			=					encoder_layerdrop
    __lowerCamelCase			:			Union[str, Any]       			=					decoder_layerdrop
    __lowerCamelCase			:			Union[str, Any]       			=					use_cache
    __lowerCamelCase			:			Tuple       			=					encoder_layers
    __lowerCamelCase			:			int       			=					scale_embedding  # scale factor will be sqrt(d_model) if True
    super().__init__(
        pad_token_id=_a     ,      eos_token_id=_a     ,      is_encoder_decoder=_a     ,      decoder_start_token_id=_a     ,      forced_eos_token_id=_a     ,      **_a     ,      )




  @property
  def 		_lowercase	(					self :      Optional[int]  )   ->   int:
    return self.encoder_attention_heads




  @property
  def 		_lowercase	(					self :      Any  )   ->   int:
    return self.d_model






