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


__a    :	int         =    logging.get_logger(__name__)

__a    :	List[str]         =    {
    """facebook/nllb-moe-54B""": """https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json""",
}




class   _UpperCamelCase (		_UpperCAmelCase					):


			"""simple docstring"""






			__a    :					List[str]     					=		'''nllb-moe'''
			__a    :					int     					=		['''past_key_values''']
			__a    :					Optional[int]     					=		{'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}





			def __init__(  self ,  lowerCAmelCase__=12_81_12 ,  lowerCAmelCase__=10_24 ,  lowerCAmelCase__=12 ,  lowerCAmelCase__=40_96 ,  lowerCAmelCase__=16 ,  lowerCAmelCase__=12 ,  lowerCAmelCase__=40_96 ,  lowerCAmelCase__=16 ,  lowerCAmelCase__=0.05 ,  lowerCAmelCase__=0.05 ,  lowerCAmelCase__=True ,  lowerCAmelCase__=True ,  lowerCAmelCase__="relu" ,  lowerCAmelCase__=10_24 ,  lowerCAmelCase__=0.1 ,  lowerCAmelCase__=0.1 ,  lowerCAmelCase__=0.0 ,  lowerCAmelCase__=0.02 ,  lowerCAmelCase__=2 ,  lowerCAmelCase__=True ,  lowerCAmelCase__=False ,  lowerCAmelCase__="float32" ,  lowerCAmelCase__=False ,  lowerCAmelCase__=1_28 ,  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__ ,  )	->   List[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


__a    :	Tuple         =    {
    """configuration_luke""": ["""LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LukeConfig"""],
    """tokenization_luke""": ["""LukeTokenizer"""],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__a    :	Dict         =    [
		    """LUKE_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """LukeForEntityClassification""",
		    """LukeForEntityPairClassification""",
		    """LukeForEntitySpanClassification""",
		    """LukeForMultipleChoice""",
		    """LukeForQuestionAnswering""",
		    """LukeForSequenceClassification""",
		    """LukeForTokenClassification""",
		    """LukeForMaskedLM""",
		    """LukeModel""",
		    """LukePreTrainedModel""",
		]


if TYPE_CHECKING:
		from .configuration_luke import LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP, LukeConfig
		from .tokenization_luke import LukeTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_luke import (
				    LUKE_PRETRAINED_MODEL_ARCHIVE_LIST,
				    LukeForEntityClassification,
				    LukeForEntityPairClassification,
				    LukeForEntitySpanClassification,
				    LukeForMaskedLM,
				    LukeForMultipleChoice,
				    LukeForQuestionAnswering,
				    LukeForSequenceClassification,
				    LukeForTokenClassification,
				    LukeModel,
				    LukePreTrainedModel,
				)

else:
		import sys

		__a    :	Any         =    _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)