

import copy

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


SCREAMING_SNAKE_CASE						:Any      =			logging.get_logger(__name__)

SCREAMING_SNAKE_CASE						:Dict      =			{}






class 		__magic_name__ (				snake_case							):
     UpperCamelCase_     :str									=	"""fsmt_decoder"""






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






class 		__magic_name__ (				snake_case							):
     UpperCamelCase_     :List[str]									=	"""fsmt"""
     UpperCamelCase_     :List[Any]									=	{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}






     def __init__(							self						,		_lowercase=["en", "de"]						,		_lowercase=42_024						,		_lowercase=42_024						,		_lowercase="relu"						,		_lowercase=1_024						,		_lowercase=200						,		_lowercase=1_024						,		_lowercase=4_096						,		_lowercase=12						,		_lowercase=16						,		_lowercase=0.0						,		_lowercase=4_096						,		_lowercase=12						,		_lowercase=16						,		_lowercase=0.0						,		_lowercase=0.0						,		_lowercase=0.1						,		_lowercase=0.0						,		_lowercase=0.02						,		_lowercase=2						,		_lowercase=True						,		_lowercase=True						,		_lowercase=False						,		_lowercase=5						,		_lowercase=1.0						,		_lowercase=False						,		_lowercase=True						,		_lowercase=1						,		_lowercase=0						,		_lowercase=2						,		_lowercase=2						,		**_lowercase						,		)->			Tuple:
         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=__A						,		bos_token_id=__A     )
         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=__A						,		bos_token_id=__A						,		eos_token_id=__A						,		decoder_start_token_id=__A						,		is_encoder_decoder=__A						,		tie_word_embeddings=__A						,		forced_eos_token_id=__A						,		max_length=__A						,		num_beams=__A						,		length_penalty=__A						,		early_stopping=__A						,		**__A						,		)






     def      UpperCAmelCase_							(							self     )->			List[Any]:
         UpperCamelCase_          =		copy.deepcopy(self.__dict__     )
         UpperCamelCase_          =		self.decoder.to_dict()
         UpperCamelCase_          =		self.__class__.model_type
         return output








import copy

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


__A          = logging.get_logger(__name__)

__A          = {}





class   SCREAMING_SNAKE_CASE (       snake_case    ):





							"""simple docstring"""

							A_       =    "fsmt_decoder"

							def __init__(     self:      List[Any]						,   __A:      Dict=0						,   __A:      str=0      )			-> Optional[int]:
												super().__init__()
												_A									=       vocab_size
												_A									=       bos_token_id





class   SCREAMING_SNAKE_CASE (       snake_case    ):





							"""simple docstring"""

							A_       =    "fsmt"
							A_       =    {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}

							def __init__(     self:      Optional[Any]						,   __A:      Optional[Any]=["en", "de"]						,   __A:      List[str]=4_20_24						,   __A:      Any=4_20_24						,   __A:      Optional[int]="relu"						,   __A:      List[str]=10_24						,   __A:      str=2_00						,   __A:      Tuple=10_24						,   __A:      List[str]=40_96						,   __A:      List[Any]=12						,   __A:      Union[str, Any]=16						,   __A:      List[str]=0.0						,   __A:      int=40_96						,   __A:      Union[str, Any]=12						,   __A:      List[str]=16						,   __A:      Union[str, Any]=0.0						,   __A:      int=0.0						,   __A:      str=0.1						,   __A:      int=0.0						,   __A:      Union[str, Any]=0.02						,   __A:      Tuple=2						,   __A:      int=True						,   __A:      Dict=True						,   __A:      int=False						,   __A:      Any=5						,   __A:      Tuple=1.0						,   __A:      Optional[int]=False						,   __A:      List[Any]=True						,   __A:      Tuple=1						,   __A:      List[Any]=0						,   __A:      Any=2						,   __A:      Optional[Any]=2						,   **__A:      Optional[Any]						,   )			-> Tuple:
												_A									=       langs
												_A									=       src_vocab_size
												_A									=       tgt_vocab_size
												_A									=       d_model  # encoder_embed_dim and decoder_embed_dim

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

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

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

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

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



							def 					__A       (     self:      Optional[int]      )			-> List[Any]:
												_A									=       copy.deepcopy(self.__dict__      )
												_A									=       self.decoder.to_dict()
												_A									=       self.__class__.model_type
												return output



