






import copy

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


a    =       logging.get_logger(__name__)

a    =       {}
class        __snake_case(					__UpperCamelCase      ):
 lowercase :       Union[str, Any]		      =		'''fsmt_decoder'''



 def __init__(	self   :   Dict ,		UpperCAmelCase__   :   Dict=0 ,		UpperCAmelCase__   :   Dict=0	):

    """simple docstring"""






    super().__init__()
    lowercase__						:	Optional[Any]         = vocab_size
    lowercase__						:	str         = bos_token_id
class        __snake_case(					__UpperCamelCase      ):
 lowercase :       Optional[int]		      =		'''fsmt'''
 lowercase :       Union[str, Any]		      =		{'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}



 def __init__(	self   :   Optional[int] ,		UpperCAmelCase__   :   Optional[Any]=["en", "de"] ,		UpperCAmelCase__   :   Optional[int]=42_024 ,		UpperCAmelCase__   :   Union[str, Any]=42_024 ,		UpperCAmelCase__   :   Union[str, Any]="relu" ,		UpperCAmelCase__   :   List[Any]=1_024 ,		UpperCAmelCase__   :   Tuple=200 ,		UpperCAmelCase__   :   Optional[Any]=1_024 ,		UpperCAmelCase__   :   Any=4_096 ,		UpperCAmelCase__   :   Tuple=12 ,		UpperCAmelCase__   :   Tuple=16 ,		UpperCAmelCase__   :   Dict=0.0 ,		UpperCAmelCase__   :   Tuple=4_096 ,		UpperCAmelCase__   :   Tuple=12 ,		UpperCAmelCase__   :   List[str]=16 ,		UpperCAmelCase__   :   int=0.0 ,		UpperCAmelCase__   :   Optional[Any]=0.0 ,		UpperCAmelCase__   :   Dict=0.1 ,		UpperCAmelCase__   :   Optional[Any]=0.0 ,		UpperCAmelCase__   :   Dict=0.02 ,		UpperCAmelCase__   :   Optional[Any]=2 ,		UpperCAmelCase__   :   Tuple=True ,		UpperCAmelCase__   :   Any=True ,		UpperCAmelCase__   :   Dict=False ,		UpperCAmelCase__   :   Optional[Any]=5 ,		UpperCAmelCase__   :   Union[str, Any]=1.0 ,		UpperCAmelCase__   :   Optional[Any]=False ,		UpperCAmelCase__   :   Dict=True ,		UpperCAmelCase__   :   Union[str, Any]=1 ,		UpperCAmelCase__   :   Tuple=0 ,		UpperCAmelCase__   :   Optional[Any]=2 ,		UpperCAmelCase__   :   str=2 ,		**UpperCAmelCase__   :   List[str] ,		):

    """simple docstring"""






    lowercase__						:	Any         = langs
    lowercase__						:	List[str]         = src_vocab_size
    lowercase__						:	Dict         = tgt_vocab_size
    lowercase__						:	Optional[int]         = d_model  # encoder_embed_dim and decoder_embed_dim

    lowercase__						:	Any         = encoder_ffn_dim
    lowercase__						:	str         = encoder_layers
    lowercase__						:	List[str]         = encoder_attention_heads
    lowercase__						:	Optional[Any]         = encoder_layerdrop
    lowercase__						:	List[str]         = decoder_layerdrop
    lowercase__						:	Union[str, Any]         = decoder_ffn_dim
    lowercase__						:	List[str]         = decoder_layers
    lowercase__						:	Any         = decoder_attention_heads
    lowercase__						:	int         = max_position_embeddings
    lowercase__						:	int         = init_std  # Normal(0, this parameter)
    lowercase__						:	Optional[Any]         = activation_function

    lowercase__						:	Union[str, Any]         = DecoderConfig(vocab_size=UpperCAmelCase__ ,		bos_token_id=UpperCAmelCase__	)
    if "decoder" in common_kwargs:
       del common_kwargs["decoder"]

    lowercase__						:	int         = scale_embedding  # scale factor will be sqrt(d_model) if True

    # 3 Types of Dropout
    lowercase__						:	Optional[int]         = attention_dropout
    lowercase__						:	Any         = activation_dropout
    lowercase__						:	Dict         = dropout

    lowercase__						:	Dict         = use_cache
    super().__init__(
        pad_token_id=UpperCAmelCase__ ,		bos_token_id=UpperCAmelCase__ ,		eos_token_id=UpperCAmelCase__ ,		decoder_start_token_id=UpperCAmelCase__ ,		is_encoder_decoder=UpperCAmelCase__ ,		tie_word_embeddings=UpperCAmelCase__ ,		forced_eos_token_id=UpperCAmelCase__ ,		max_length=UpperCAmelCase__ ,		num_beams=UpperCAmelCase__ ,		length_penalty=UpperCAmelCase__ ,		early_stopping=UpperCAmelCase__ ,		**UpperCAmelCase__ ,		)







 def 						UpperCAmelCase    (	self   :   Tuple	):

    """simple docstring"""






    lowercase__						:	Optional[Any]         = copy.deepcopy(self.__dict__	)
    lowercase__						:	List[str]         = self.decoder.to_dict()
    lowercase__						:	str         = self.__class__.model_type
    return output










from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a    =       {'configuration_nat': ['NAT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'NatConfig']}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a    =       [
     'NAT_PRETRAINED_MODEL_ARCHIVE_LIST',
     'NatForImageClassification',
     'NatModel',
     'NatPreTrainedModel',
     'NatBackbone',
 ]

if TYPE_CHECKING:
 from .configuration_nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_nat import (
      NAT_PRETRAINED_MODEL_ARCHIVE_LIST,
      NatBackbone,
      NatForImageClassification,
      NatModel,
      NatPreTrainedModel,
  )

else:
 import sys

 a    =       _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


