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


lowercase_     :   List[str] 				=				logging.get_logger(__name__)

lowercase_     :   Optional[int] 				=				{
    'facebook/nllb-moe-54B': 'https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json',
}






class 		_lowerCamelCase		(   UpperCamelCase_    ):
    __a  =      "nllb-moe"
    __a  =      ["past_key_values"]
    __a  =      {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}
    def __init__(  self , lowerCAmelCase=128112 , lowerCAmelCase=1024 , lowerCAmelCase=12 , lowerCAmelCase=4096 , lowerCAmelCase=16 , lowerCAmelCase=12 , lowerCAmelCase=4096 , lowerCAmelCase=16 , lowerCAmelCase=0.05 , lowerCAmelCase=0.05 , lowerCAmelCase=True , lowerCAmelCase=True , lowerCAmelCase="relu" , lowerCAmelCase=1024 , lowerCAmelCase=0.1 , lowerCAmelCase=0.1 , lowerCAmelCase=0.0 , lowerCAmelCase=0.02 , lowerCAmelCase=2 , lowerCAmelCase=True , lowerCAmelCase=False , lowerCAmelCase="float32" , lowerCAmelCase=False , lowerCAmelCase=128 , lowerCAmelCase=64 , lowerCAmelCase=4 , lowerCAmelCase=4 , lowerCAmelCase=0.001 , lowerCAmelCase=0.001 , lowerCAmelCase="all" , lowerCAmelCase=False , lowerCAmelCase=False , lowerCAmelCase=1.0 , lowerCAmelCase=0.2 , lowerCAmelCase=1 , lowerCAmelCase=0 , lowerCAmelCase=2 , lowerCAmelCase=False , **lowerCAmelCase , )       ->					Any:
     SCREAMING_SNAKE_CASE__:   List[Any]=      vocab_size
     SCREAMING_SNAKE_CASE__:   int=      max_position_embeddings
     SCREAMING_SNAKE_CASE__:   Dict=      d_model
     SCREAMING_SNAKE_CASE__:   Optional[int]=      encoder_ffn_dim
     SCREAMING_SNAKE_CASE__:   int=      encoder_layers
     SCREAMING_SNAKE_CASE__:   Union[str, Any]=      encoder_attention_heads
     SCREAMING_SNAKE_CASE__:   List[Any]=      decoder_ffn_dim
     SCREAMING_SNAKE_CASE__:   Tuple=      decoder_layers
     SCREAMING_SNAKE_CASE__:   int=      decoder_attention_heads
     SCREAMING_SNAKE_CASE__:   List[str]=      dropout
     SCREAMING_SNAKE_CASE__:   List[Any]=      attention_dropout
     SCREAMING_SNAKE_CASE__:   Dict=      activation_dropout
     SCREAMING_SNAKE_CASE__:   Any=      activation_function
     SCREAMING_SNAKE_CASE__:   Dict=      init_std
     SCREAMING_SNAKE_CASE__:   int=      encoder_layerdrop
     SCREAMING_SNAKE_CASE__:   str=      decoder_layerdrop
     SCREAMING_SNAKE_CASE__:   Optional[Any]=      use_cache
     SCREAMING_SNAKE_CASE__:   List[str]=      encoder_layers
     SCREAMING_SNAKE_CASE__:   Any=      scale_embedding  # scale factor will be sqrt(d_model) if True
     SCREAMING_SNAKE_CASE__:   List[str]=      router_z_loss_coef
     SCREAMING_SNAKE_CASE__:   int=      router_aux_loss_coef
     SCREAMING_SNAKE_CASE__:   List[Any]=      decoder_sparse_step
     SCREAMING_SNAKE_CASE__:   List[Any]=      encoder_sparse_step
     SCREAMING_SNAKE_CASE__:   List[str]=      num_experts
     SCREAMING_SNAKE_CASE__:   Any=      expert_capacity
     SCREAMING_SNAKE_CASE__:   Dict=      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}'   )
     SCREAMING_SNAKE_CASE__:   int=      router_dtype

     SCREAMING_SNAKE_CASE__:   Optional[Any]=      router_ignore_padding_tokens
     SCREAMING_SNAKE_CASE__:   Optional[Any]=      batch_prioritized_routing
     SCREAMING_SNAKE_CASE__:   List[str]=      second_expert_policy
     SCREAMING_SNAKE_CASE__:   int=      normalize_router_prob_before_dropping
     SCREAMING_SNAKE_CASE__:   List[Any]=      moe_eval_capacity_token_fraction
     SCREAMING_SNAKE_CASE__:   int=      moe_token_dropout
     SCREAMING_SNAKE_CASE__:   List[str]=      output_router_logits
     super().__init__(
         pad_token_id=lowerCAmelCase , bos_token_id=lowerCAmelCase , eos_token_id=lowerCAmelCase , is_encoder_decoder=lowerCAmelCase , decoder_start_token_id=lowerCAmelCase , **lowerCAmelCase , )


from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase_     :   Dict 				=				{
    'configuration_autoformer': [
        'AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'AutoformerConfig',
    ],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_     :   str 				=				[
          'AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
          'AutoformerForPrediction',
          'AutoformerModel',
          'AutoformerPreTrainedModel',
      ]


if TYPE_CHECKING:
      from .configuration_autoformer import (
          AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
          AutoformerConfig,
      )

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_autoformer import (
                AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                AutoformerForPrediction,
                AutoformerModel,
                AutoformerPreTrainedModel,
            )

else:
      import sys

      lowercase_     :   Tuple 				=				_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

