

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


lowercase_   							=  logging.get_logger(__name__)

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





class 					__lowerCAmelCase	(   SCREAMING_SNAKE_CASE				):
  _a		     =    """nllb-moe"""
  _a		     =    ["""past_key_values"""]
  _a		     =    {"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}




  def __init__(							self				,  lowerCAmelCase=128_112				,  lowerCAmelCase=1_024				,  lowerCAmelCase=12				,  lowerCAmelCase=4_096				,  lowerCAmelCase=16				,  lowerCAmelCase=12				,  lowerCAmelCase=4_096				,  lowerCAmelCase=16				,  lowerCAmelCase=0.05				,  lowerCAmelCase=0.05				,  lowerCAmelCase=True				,  lowerCAmelCase=True				,  lowerCAmelCase="relu"				,  lowerCAmelCase=1_024				,  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:
        '''simple docstring'''






        _lowercase      			=vocab_size
        _lowercase      			=max_position_embeddings
        _lowercase      			=d_model
        _lowercase      			=encoder_ffn_dim
        _lowercase      			=encoder_layers
        _lowercase      			=encoder_attention_heads
        _lowercase      			=decoder_ffn_dim
        _lowercase      			=decoder_layers
        _lowercase      			=decoder_attention_heads
        _lowercase      			=dropout
        _lowercase      			=attention_dropout
        _lowercase      			=activation_dropout
        _lowercase      			=activation_function
        _lowercase      			=init_std
        _lowercase      			=encoder_layerdrop
        _lowercase      			=decoder_layerdrop
        _lowercase      			=use_cache
        _lowercase      			=encoder_layers
        _lowercase      			=scale_embedding  # scale factor will be sqrt(d_model) if True
        _lowercase      			=router_z_loss_coef
        _lowercase      			=router_aux_loss_coef
        _lowercase      			=decoder_sparse_step
        _lowercase      			=encoder_sparse_step
        _lowercase      			=num_experts
        _lowercase      			=expert_capacity
        _lowercase      			=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}'''   )
        _lowercase      			=router_dtype

        _lowercase      			=router_ignore_padding_tokens
        _lowercase      			=batch_prioritized_routing
        _lowercase      			=second_expert_policy
        _lowercase      			=normalize_router_prob_before_dropping
        _lowercase      			=moe_eval_capacity_token_fraction
        _lowercase      			=moe_token_dropout
        _lowercase      			=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

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase_   							=  {
    'configuration_timesformer': ['TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'TimesformerConfig'],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_   							=  [
      'TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
      'TimesformerModel',
      'TimesformerForVideoClassification',
      'TimesformerPreTrainedModel',
  ]

if TYPE_CHECKING:
  from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_timesformer import (
        TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        TimesformerForVideoClassification,
        TimesformerModel,
        TimesformerPreTrainedModel,
    )

else:
  import sys

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


