



import copy

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


__lowerCAmelCase     =			logging.get_logger(__name__)

__lowerCAmelCase     =			{}




class   _UpperCAmelCase	(   _lowercase					):
					__A          =   "fsmt_decoder"




					def __init__(						self    ,      __lowerCAmelCase=0    ,      __lowerCAmelCase=0       )						->  Optional[int]:
							super().__init__()
							UpperCamelCase__         =	vocab_size
							UpperCamelCase__         =	bos_token_id




class   _UpperCAmelCase	(   _lowercase					):
					__A          =   "fsmt"
					__A          =   {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}




					def __init__(						self    ,      __lowerCAmelCase=["en", "de"]    ,      __lowerCAmelCase=42_024    ,      __lowerCAmelCase=42_024    ,      __lowerCAmelCase="relu"    ,      __lowerCAmelCase=1_024    ,      __lowerCAmelCase=200    ,      __lowerCAmelCase=1_024    ,      __lowerCAmelCase=4_096    ,      __lowerCAmelCase=12    ,      __lowerCAmelCase=16    ,      __lowerCAmelCase=0.0    ,      __lowerCAmelCase=4_096    ,      __lowerCAmelCase=12    ,      __lowerCAmelCase=16    ,      __lowerCAmelCase=0.0    ,      __lowerCAmelCase=0.0    ,      __lowerCAmelCase=0.1    ,      __lowerCAmelCase=0.0    ,      __lowerCAmelCase=0.0_2    ,      __lowerCAmelCase=2    ,      __lowerCAmelCase=True    ,      __lowerCAmelCase=True    ,      __lowerCAmelCase=False    ,      __lowerCAmelCase=5    ,      __lowerCAmelCase=1.0    ,      __lowerCAmelCase=False    ,      __lowerCAmelCase=True    ,      __lowerCAmelCase=1    ,      __lowerCAmelCase=0    ,      __lowerCAmelCase=2    ,      __lowerCAmelCase=2    ,      **__lowerCAmelCase    ,      )						->  Optional[Any]:
							UpperCamelCase__         =	langs
							UpperCamelCase__         =	src_vocab_size
							UpperCamelCase__         =	tgt_vocab_size
							UpperCamelCase__         =	d_model  # encoder_embed_dim and decoder_embed_dim

							UpperCamelCase__         =	encoder_ffn_dim
							UpperCamelCase__         =	UpperCamelCase__         =	encoder_layers
							UpperCamelCase__         =	encoder_attention_heads
							UpperCamelCase__         =	encoder_layerdrop
							UpperCamelCase__         =	decoder_layerdrop
							UpperCamelCase__         =	decoder_ffn_dim
							UpperCamelCase__         =	decoder_layers
							UpperCamelCase__         =	decoder_attention_heads
							UpperCamelCase__         =	max_position_embeddings
							UpperCamelCase__         =	init_std  # Normal(0, this parameter)
							UpperCamelCase__         =	activation_function

							UpperCamelCase__         =	DecoderConfig(vocab_size=__lowerCAmelCase    ,      bos_token_id=__lowerCAmelCase       )
							if "decoder" in common_kwargs:
									del common_kwargs["decoder"]

							UpperCamelCase__         =	scale_embedding  # scale factor will be sqrt(d_model) if True

							# 3 Types of Dropout
							UpperCamelCase__         =	attention_dropout
							UpperCamelCase__         =	activation_dropout
							UpperCamelCase__         =	dropout

							UpperCamelCase__         =	use_cache
							super().__init__(
							    pad_token_id=__lowerCAmelCase    ,      bos_token_id=__lowerCAmelCase    ,      eos_token_id=__lowerCAmelCase    ,      decoder_start_token_id=__lowerCAmelCase    ,      is_encoder_decoder=__lowerCAmelCase    ,      tie_word_embeddings=__lowerCAmelCase    ,      forced_eos_token_id=__lowerCAmelCase    ,      max_length=__lowerCAmelCase    ,      num_beams=__lowerCAmelCase    ,      length_penalty=__lowerCAmelCase    ,      early_stopping=__lowerCAmelCase    ,      **__lowerCAmelCase    ,      )




					def 	snake_case_		(						self       )						->  str:
							UpperCamelCase__         =	copy.deepcopy(self.__dict__       )
							UpperCamelCase__         =	self.decoder.to_dict()
							UpperCamelCase__         =	self.__class__.model_type
							return output












def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) * 9 / 5) + 3_2 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round(float(_lowercase       ) + 273.15 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) * 9 / 5) + 491.67 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) - 3_2) * 5 / 9 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round(((float(_lowercase       ) - 3_2) * 5 / 9) + 273.15 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round(float(_lowercase       ) + 459.67 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round(float(_lowercase       ) - 273.15 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round(((float(_lowercase       ) - 273.15) * 9 / 5) + 3_2 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) * 9 / 5) ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) - 491.67) * 5 / 9 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round(float(_lowercase       ) - 459.67 ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) * 5 / 9) ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) * 1.25 + 273.15) ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) * 2.25 + 3_2) ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) * 1.25) ,						_lowercase       )

def     a						(      _lowercase   :     float ,						_lowercase   :     int = 2       )     ->float:
		return round((float(_lowercase       ) * 2.25 + 3_2 + 459.67) ,						_lowercase       )


if __name__ == "__main__":
				import doctest

				doctest.testmod()





