



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


__snake_case     :Union[str, Any]			       =logging.get_logger(__name__)

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



class        lowerCAmelCase__					(  _lowerCamelCase       ):
				A_   :     Dict								=     'nllb-moe'
				A_   :     Optional[int]								=     ['past_key_values']
				A_   :     Any								=     {'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}


				def __init__(							self      :  int						, __UpperCamelCase      :  int=128_112						, __UpperCamelCase      :  str=1_024						, __UpperCamelCase      :  Optional[Any]=12						, __UpperCamelCase      :  str=4_096						, __UpperCamelCase      :  Tuple=16						, __UpperCamelCase      :  List[str]=12						, __UpperCamelCase      :  Optional[Any]=4_096						, __UpperCamelCase      :  int=16						, __UpperCamelCase      :  str=0.0_5						, __UpperCamelCase      :  Optional[Any]=0.0_5						, __UpperCamelCase      :  Dict=True						, __UpperCamelCase      :  List[Any]=True						, __UpperCamelCase      :  Any="relu"						, __UpperCamelCase      :  Any=1_024						, __UpperCamelCase      :  Dict=0.1						, __UpperCamelCase      :  Union[str, Any]=0.1						, __UpperCamelCase      :  int=0.0						, __UpperCamelCase      :  int=0.0_2						, __UpperCamelCase      :  str=2						, __UpperCamelCase      :  str=True						, __UpperCamelCase      :  Dict=False						, __UpperCamelCase      :  List[Any]="float32"						, __UpperCamelCase      :  Tuple=False						, __UpperCamelCase      :  Any=128						, __UpperCamelCase      :  Optional[int]=64						, __UpperCamelCase      :  List[str]=4						, __UpperCamelCase      :  Dict=4						, __UpperCamelCase      :  int=0.0_0_1						, __UpperCamelCase      :  Dict=0.0_0_1						, __UpperCamelCase      :  Optional[Any]="all"						, __UpperCamelCase      :  List[str]=False						, __UpperCamelCase      :  Tuple=False						, __UpperCamelCase      :  Any=1.0						, __UpperCamelCase      :  List[str]=0.2						, __UpperCamelCase      :  str=1						, __UpperCamelCase      :  Optional[int]=0						, __UpperCamelCase      :  Union[str, Any]=2						, __UpperCamelCase      :  Dict=False						, **__UpperCamelCase      :  Optional[Any]						, )		->     Optional[int]:
											A      						=    vocab_size
											A      						=    max_position_embeddings
											A      						=    d_model
											A      						=    encoder_ffn_dim
											A      						=    encoder_layers
											A      						=    encoder_attention_heads
											A      						=    decoder_ffn_dim
											A      						=    decoder_layers
											A      						=    decoder_attention_heads
											A      						=    dropout
											A      						=    attention_dropout
											A      						=    activation_dropout
											A      						=    activation_function
											A      						=    init_std
											A      						=    encoder_layerdrop
											A      						=    decoder_layerdrop
											A      						=    use_cache
											A      						=    encoder_layers
											A      						=    scale_embedding  # scale factor will be sqrt(d_model) if True
											A      						=    router_z_loss_coef
											A      						=    router_aux_loss_coef
											A      						=    decoder_sparse_step
											A      						=    encoder_sparse_step
											A      						=    num_experts
											A      						=    expert_capacity
											A      						=    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}'''       )
											A      						=    router_dtype

											A      						=    router_ignore_padding_tokens
											A      						=    batch_prioritized_routing
											A      						=    second_expert_policy
											A      						=    normalize_router_prob_before_dropping
											A      						=    moe_eval_capacity_token_fraction
											A      						=    moe_token_dropout
											A      						=    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						, )



from ..utils import DummyObject, requires_backends







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Tuple			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> str:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> int:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> str:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Optional[Any]			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> Dict:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> List[str]:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Dict:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					str			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> Dict:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Union[str, Any]:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Optional[int]:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					str			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> List[Any]:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Any:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Union[str, Any]:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Dict			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> Optional[Any]:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Optional[Any]:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Any:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Optional[int]			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> int:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> int:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> str:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Union[str, Any]			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> List[Any]:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Tuple:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Optional[int]:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Optional[Any]			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> Optional[Any]:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> int:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> int:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Tuple			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> str:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> List[Any]:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> str:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Any			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> List[str]:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> int:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> str:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					str			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> Dict:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Optional[int]:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Dict:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Optional[int]			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> List[str]:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Any:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Any:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







class        __lowercase       (							metaclass=a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Tuple			       =		["flax"]







		def __init__( self		,      *A		,      **A	)  -> str:







					'''simple docstring'''







					requires_backends(self		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Dict:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)







		@classmethod
		def 					__A   ( cls		,      *A		,      **A	)  -> Union[str, Any]:







					'''simple docstring'''







					requires_backends(cls		,      ["""flax"""]	)

