



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     (	lowerCAmelCase__   ):
 lowerCAmelCase__       					=  """nllb-moe"""
 lowerCAmelCase__       					=  ["""past_key_values"""]
 lowerCAmelCase__       					=  {"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}




 def __init__(						self	,				__UpperCAmelCase=128112	,				__UpperCAmelCase=1024	,				__UpperCAmelCase=12	,				__UpperCAmelCase=4096	,				__UpperCAmelCase=16	,				__UpperCAmelCase=12	,				__UpperCAmelCase=4096	,				__UpperCAmelCase=16	,				__UpperCAmelCase=0.05	,				__UpperCAmelCase=0.05	,				__UpperCAmelCase=True	,				__UpperCAmelCase=True	,				__UpperCAmelCase="relu"	,				__UpperCAmelCase=1024	,				__UpperCAmelCase=0.1	,				__UpperCAmelCase=0.1	,				__UpperCAmelCase=0.0	,				__UpperCAmelCase=0.02	,				__UpperCAmelCase=2	,				__UpperCAmelCase=True	,				__UpperCAmelCase=False	,				__UpperCAmelCase="float32"	,				__UpperCAmelCase=False	,				__UpperCAmelCase=128	,				__UpperCAmelCase=64	,				__UpperCAmelCase=4	,				__UpperCAmelCase=4	,				__UpperCAmelCase=0.001	,				__UpperCAmelCase=0.001	,				__UpperCAmelCase="all"	,				__UpperCAmelCase=False	,				__UpperCAmelCase=False	,				__UpperCAmelCase=1.0	,				__UpperCAmelCase=0.2	,				__UpperCAmelCase=1	,				__UpperCAmelCase=0	,				__UpperCAmelCase=2	,				__UpperCAmelCase=False	,				**__UpperCAmelCase	,				):



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

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











import inspect
import re

from transformers.utils import direct_transformers_import


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_config_docstrings.py
a_			=					"""src/transformers"""


# This is to make sure the transformers module imported is the one in the repo.
a_			=					direct_transformers_import(PATH_TO_TRANSFORMERS)

a_			=					transformers.models.auto.configuration_auto.CONFIG_MAPPING

# Regex pattern used to find the checkpoint mentioned in the docstring of `config_class`.
# For example, `[bert-base-uncased](https://huggingface.co/bert-base-uncased)`
a_			=					re.compile(R"""\[(.+?)\]\((https://huggingface\.co/.+?)\)""")


a_			=					{
    """DecisionTransformerConfig""",
    """EncoderDecoderConfig""",
    """MusicgenConfig""",
    """RagConfig""",
    """SpeechEncoderDecoderConfig""",
    """TimmBackboneConfig""",
    """VisionEncoderDecoderConfig""",
    """VisionTextDualEncoderConfig""",
    """LlamaConfig""",
}





def 		a__			(		_UpperCamelCase			: Union[str, Any]							):
   __lowerCamelCase													=    None

   # source code of `config_class`
   __lowerCamelCase													=    inspect.getsource(_UpperCamelCase							)
   __lowerCamelCase													=    _re_checkpoint.findall(_UpperCamelCase							)

   # Each `checkpoint` is a tuple of a checkpoint name and a checkpoint link.
   # For example, `('bert-base-uncased', 'https://huggingface.co/bert-base-uncased')`
   for ckpt_name, ckpt_link in checkpoints:
      # allow the link to end with `/`
      if ckpt_link.endswith('''/'''							):
         __lowerCamelCase													=    ckpt_link[:-1]

      # verify the checkpoint name corresponds to the checkpoint link
      __lowerCamelCase													=    F"""https://huggingface.co/{ckpt_name}"""
      if ckpt_link == ckpt_link_from_name:
         __lowerCamelCase													=    ckpt_name
         break

   return checkpoint





def 		a__			(		):
   __lowerCamelCase													=    []

   for config_class in list(CONFIG_MAPPING.values()							):
      # Skip deprecated models
      if "models.deprecated" in config_class.__module__:
         continue
      __lowerCamelCase													=    get_checkpoint_from_config_class(_UpperCamelCase							)

      __lowerCamelCase													=    config_class.__name__
      if checkpoint is None and name not in CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK:
         configs_without_checkpoint.append(_UpperCamelCase							)

   if len(_UpperCamelCase							) > 0:
      __lowerCamelCase													=    '''\n'''.join(sorted(_UpperCamelCase							)							)
      raise ValueError(F"""The following configurations don't contain any valid checkpoint:\n{message}"""							)


if __name__ == "__main__":
  check_config_docstrings_have_checkpoints()






