




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


a_   		=     logging.get_logger(__name__)

a_   		=     {
    "facebook/nllb-moe-54B": "https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json",
}

class  _lowerCamelCase						(			_SCREAMING_SNAKE_CASE   ):

      """simple docstring"""

      lowerCAmelCase__			: int    =					"nllb-moe"
      lowerCAmelCase__			: int    =					["past_key_values"]
      lowerCAmelCase__			: Tuple    =					{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}







      def __init__(     self					: Any ,       snake_case					: List[Any]=128112 ,       snake_case					: Tuple=1024 ,       snake_case					: int=12 ,       snake_case					: Any=4096 ,       snake_case					: int=16 ,       snake_case					: Tuple=12 ,       snake_case					: Any=4096 ,       snake_case					: int=16 ,       snake_case					: List[Any]=0.05 ,       snake_case					: Union[str, Any]=0.05 ,       snake_case					: Optional[int]=True ,       snake_case					: int=True ,       snake_case					: Tuple="relu" ,       snake_case					: Optional[int]=1024 ,       snake_case					: List[Any]=0.1 ,       snake_case					: Any=0.1 ,       snake_case					: List[Any]=0.0 ,       snake_case					: Optional[Any]=0.02 ,       snake_case					: Optional[int]=2 ,       snake_case					: Optional[Any]=True ,       snake_case					: Optional[int]=False ,       snake_case					: Tuple="float32" ,       snake_case					: Dict=False ,       snake_case					: str=128 ,       snake_case					: List[str]=64 ,       snake_case					: str=4 ,       snake_case					: Tuple=4 ,       snake_case					: Dict=0.0_01 ,       snake_case					: Union[str, Any]=0.0_01 ,       snake_case					: List[Any]="all" ,       snake_case					: int=False ,       snake_case					: Union[str, Any]=False ,       snake_case					: List[str]=1.0 ,       snake_case					: List[Any]=0.2 ,       snake_case					: Optional[Any]=1 ,       snake_case					: Dict=0 ,       snake_case					: int=2 ,       snake_case					: Any=False ,       **snake_case					: str ,       ):
          __UpperCamelCase  		=						vocab_size
          __UpperCamelCase  		=						max_position_embeddings
          __UpperCamelCase  		=						d_model
          __UpperCamelCase  		=						encoder_ffn_dim
          __UpperCamelCase  		=						encoder_layers
          __UpperCamelCase  		=						encoder_attention_heads
          __UpperCamelCase  		=						decoder_ffn_dim
          __UpperCamelCase  		=						decoder_layers
          __UpperCamelCase  		=						decoder_attention_heads
          __UpperCamelCase  		=						dropout
          __UpperCamelCase  		=						attention_dropout
          __UpperCamelCase  		=						activation_dropout
          __UpperCamelCase  		=						activation_function
          __UpperCamelCase  		=						init_std
          __UpperCamelCase  		=						encoder_layerdrop
          __UpperCamelCase  		=						decoder_layerdrop
          __UpperCamelCase  		=						use_cache
          __UpperCamelCase  		=						encoder_layers
          __UpperCamelCase  		=						scale_embedding  # scale factor will be sqrt(d_model) if True
          __UpperCamelCase  		=						router_z_loss_coef
          __UpperCamelCase  		=						router_aux_loss_coef
          __UpperCamelCase  		=						decoder_sparse_step
          __UpperCamelCase  		=						encoder_sparse_step
          __UpperCamelCase  		=						num_experts
          __UpperCamelCase  		=						expert_capacity
          __UpperCamelCase  		=						router_bias
          if router_dtype not in ["float32", "float16", "bfloat16"]:
              raise ValueError(F"`router_dtype` must be one of 'float32', 'float16' or 'bfloat16', got {router_dtype}"				)
          __UpperCamelCase  		=						router_dtype

          __UpperCamelCase  		=						router_ignore_padding_tokens
          __UpperCamelCase  		=						batch_prioritized_routing
          __UpperCamelCase  		=						second_expert_policy
          __UpperCamelCase  		=						normalize_router_prob_before_dropping
          __UpperCamelCase  		=						moe_eval_capacity_token_fraction
          __UpperCamelCase  		=						moe_token_dropout
          __UpperCamelCase  		=						output_router_logits
          super().__init__(
              pad_token_id=snake_case ,       bos_token_id=snake_case ,       eos_token_id=snake_case ,       is_encoder_decoder=snake_case ,       decoder_start_token_id=snake_case ,       **snake_case ,       )












from abc import ABC, abstractmethod
from argparse import ArgumentParser

class  _lowerCamelCase						(			_SCREAMING_SNAKE_CASE   ):

      """simple docstring"""

      @staticmethod
      @abstractmethod
      def       snake_case	(     snake_case					: ArgumentParser				):
          raise NotImplementedError()







      @abstractmethod
      def       snake_case	(     self					: Optional[Any]				):
          raise NotImplementedError()






