





import copy

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


a__			:    Any			      =		logging.get_logger(__name__)

a__			:    Union[str, Any]			      =		{}





class UpperCAmelCase_							(   _SCREAMING_SNAKE_CASE   ):
  __lowerCAmelCase      :	Union[str, Any]  	=      """fsmt_decoder"""


  def __init__(       self   ,__snake_case=0   ,__snake_case=0   ):



       """simple docstring"""





       super().__init__()
       A_					      =					vocab_size
       A_					      =					bos_token_id





class UpperCAmelCase_							(   _SCREAMING_SNAKE_CASE   ):
  __lowerCAmelCase      :	Any  	=      """fsmt"""
  __lowerCAmelCase      :	Tuple  	=      {"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}


  def __init__(       self   ,__snake_case=["en", "de"]   ,__snake_case=4_2_0_2_4   ,__snake_case=4_2_0_2_4   ,__snake_case="relu"   ,__snake_case=1_0_2_4   ,__snake_case=2_0_0   ,__snake_case=1_0_2_4   ,__snake_case=4_0_9_6   ,__snake_case=1_2   ,__snake_case=1_6   ,__snake_case=0.0   ,__snake_case=4_0_9_6   ,__snake_case=1_2   ,__snake_case=1_6   ,__snake_case=0.0   ,__snake_case=0.0   ,__snake_case=0.1   ,__snake_case=0.0   ,__snake_case=0.02   ,__snake_case=2   ,__snake_case=True   ,__snake_case=True   ,__snake_case=False   ,__snake_case=5   ,__snake_case=1.0   ,__snake_case=False   ,__snake_case=True   ,__snake_case=1   ,__snake_case=0   ,__snake_case=2   ,__snake_case=2   ,**__snake_case   ,):



       """simple docstring"""





       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=__snake_case   ,bos_token_id=__snake_case   )
       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=__snake_case   ,bos_token_id=__snake_case   ,eos_token_id=__snake_case   ,decoder_start_token_id=__snake_case   ,is_encoder_decoder=__snake_case   ,tie_word_embeddings=__snake_case   ,forced_eos_token_id=__snake_case   ,max_length=__snake_case   ,num_beams=__snake_case   ,length_penalty=__snake_case   ,early_stopping=__snake_case   ,**__snake_case   ,)




  def 	__UpperCAmelCase    (       self   ):



       """simple docstring"""





       A_					      =					copy.deepcopy(self.__dict__   )
       A_					      =					self.decoder.to_dict()
       A_					      =					self.__class__.model_type
       return output










from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


a__			:    Tuple			      =		{'configuration_yoso': ['YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP', 'YosoConfig']}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      a__			:    Optional[int]			      =		[
          'YOSO_PRETRAINED_MODEL_ARCHIVE_LIST',
          'YosoForMaskedLM',
          'YosoForMultipleChoice',
          'YosoForQuestionAnswering',
          'YosoForSequenceClassification',
          'YosoForTokenClassification',
          'YosoLayer',
          'YosoModel',
          'YosoPreTrainedModel',
      ]


if TYPE_CHECKING:
      from .configuration_yoso import YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP, YosoConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_yoso import (
                YOSO_PRETRAINED_MODEL_ARCHIVE_LIST,
                YosoForMaskedLM,
                YosoForMultipleChoice,
                YosoForQuestionAnswering,
                YosoForSequenceClassification,
                YosoForTokenClassification,
                YosoLayer,
                YosoModel,
                YosoPreTrainedModel,
            )


else:
      import sys

      a__			:    Union[str, Any]			      =		_LazyModule(__name__, globals()['__file__'], _import_structure)



