





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


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

_a     :    Union[str, Any]         =						{
    'facebook/nllb-moe-54B': 'https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json',
}
class   a_ (			lowercase_      ):
			A__      :			Tuple       	=  'nllb-moe'
			A__      :			Dict       	=  ['past_key_values']
			A__      :			List[Any]       	=  {'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}

			def __init__(   self   :  Union[str, Any]     , UpperCAmelCase__   :  int=128_112     , UpperCAmelCase__   :  str=1_024     , UpperCAmelCase__   :  Optional[Any]=12     , UpperCAmelCase__   :  List[str]=4_096     , UpperCAmelCase__   :  Optional[int]=16     , UpperCAmelCase__   :  str=12     , UpperCAmelCase__   :  Tuple=4_096     , UpperCAmelCase__   :  Optional[int]=16     , UpperCAmelCase__   :  Dict=0.05     , UpperCAmelCase__   :  int=0.05     , UpperCAmelCase__   :  Optional[int]=True     , UpperCAmelCase__   :  List[str]=True     , UpperCAmelCase__   :  str="relu"     , UpperCAmelCase__   :  int=1_024     , UpperCAmelCase__   :  str=0.1     , UpperCAmelCase__   :  Any=0.1     , UpperCAmelCase__   :  Optional[int]=0.0     , UpperCAmelCase__   :  Dict=0.02     , UpperCAmelCase__   :  Dict=2     , UpperCAmelCase__   :  str=True     , UpperCAmelCase__   :  Dict=False     , UpperCAmelCase__   :  Tuple="float32"     , UpperCAmelCase__   :  List[Any]=False     , UpperCAmelCase__   :  List[str]=128     , UpperCAmelCase__   :  str=64     , UpperCAmelCase__   :  Tuple=4     , UpperCAmelCase__   :  Any=4     , UpperCAmelCase__   :  Optional[Any]=0.001     , UpperCAmelCase__   :  List[Any]=0.001     , UpperCAmelCase__   :  int="all"     , UpperCAmelCase__   :  List[str]=False     , UpperCAmelCase__   :  List[Any]=False     , UpperCAmelCase__   :  Any=1.0     , UpperCAmelCase__   :  List[str]=0.2     , UpperCAmelCase__   :  Optional[Any]=1     , UpperCAmelCase__   :  int=0     , UpperCAmelCase__   :  Dict=2     , UpperCAmelCase__   :  str=False     , **UpperCAmelCase__   :  Dict     , ):






							"""simple docstring"""
							snake_case   :					int    						=				vocab_size
							snake_case   :					Union[str, Any]    						=				max_position_embeddings
							snake_case   :					int    						=				d_model
							snake_case   :					Dict    						=				encoder_ffn_dim
							snake_case   :					List[str]    						=				encoder_layers
							snake_case   :					Optional[int]    						=				encoder_attention_heads
							snake_case   :					str    						=				decoder_ffn_dim
							snake_case   :					int    						=				decoder_layers
							snake_case   :					Dict    						=				decoder_attention_heads
							snake_case   :					Tuple    						=				dropout
							snake_case   :					Any    						=				attention_dropout
							snake_case   :					str    						=				activation_dropout
							snake_case   :					int    						=				activation_function
							snake_case   :					Dict    						=				init_std
							snake_case   :					Optional[int]    						=				encoder_layerdrop
							snake_case   :					Any    						=				decoder_layerdrop
							snake_case   :					int    						=				use_cache
							snake_case   :					Dict    						=				encoder_layers
							snake_case   :					Optional[Any]    						=				scale_embedding  # scale factor will be sqrt(d_model) if True
							snake_case   :					Any    						=				router_z_loss_coef
							snake_case   :					Optional[int]    						=				router_aux_loss_coef
							snake_case   :					Any    						=				decoder_sparse_step
							snake_case   :					Optional[int]    						=				encoder_sparse_step
							snake_case   :					List[str]    						=				num_experts
							snake_case   :					Any    						=				expert_capacity
							snake_case   :					Any    						=				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}"						)
							snake_case   :					Tuple    						=				router_dtype

							snake_case   :					Optional[Any]    						=				router_ignore_padding_tokens
							snake_case   :					Optional[Any]    						=				batch_prioritized_routing
							snake_case   :					Optional[int]    						=				second_expert_policy
							snake_case   :					Any    						=				normalize_router_prob_before_dropping
							snake_case   :					Dict    						=				moe_eval_capacity_token_fraction
							snake_case   :					Any    						=				moe_token_dropout
							snake_case   :					Optional[Any]    						=				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_     , )







'''simple docstring'''




from ..utils import DummyObject, requires_backends




class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Optional[int]      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[int]      ,						*lowerCamelCase_				:			List[Any]      ,						**lowerCamelCase_				:			str						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[str]      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			str						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			Dict      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Optional[Any]      ,						*lowerCamelCase_				:			Optional[int]      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			str      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[Any]      ,						*lowerCamelCase_				:			str      ,						**lowerCamelCase_				:			List[Any]						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[Any]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			str      ,						**lowerCamelCase_				:			Optional[Any]						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[str]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			Optional[int]      ,						**lowerCamelCase_				:			str						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Any      ,						*lowerCamelCase_				:			List[Any]      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			Union[str, Any]      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			str      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Dict      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			Tuple      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Optional[Any]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			List[Any]						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			List[str]						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			List[str]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Dict      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			int      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Optional[Any]						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Optional[int]      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[Any]      ,						*lowerCamelCase_				:			List[Any]      ,						**lowerCamelCase_				:			List[Any]						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Any      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			List[str]						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[Any]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Optional[Any]						):

							'''simple docstring'''



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







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Tuple      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



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


					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[Any]      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



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



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



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



