





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   ):

  '''simple docstring'''





  __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   ):

  '''simple docstring'''





  __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 __future__ import annotations

def     UpperCAmelCase_						(						_UpperCAmelCase       :list							)  ->							int | float:
     '''simple docstring'''


     A_					      =					sorted(_UpperCAmelCase							)
     A_					      =					len(_UpperCAmelCase							)
     A_					      =					length >> 1
     return (
         (sorted_list[mid_index] + sorted_list[mid_index - 1]) / 2
         if length % 2 == 0
         else sorted_list[mid_index]
     )

def     UpperCAmelCase_						(						)  ->							Optional[Any]:
     '''simple docstring'''


     import doctest

     doctest.testmod()


if __name__ == "__main__":
      main()



