


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


snake_case__			 =						logging.get_logger(__name__)

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


class 					lowerCAmelCase_ (       _a):
      lowerCamelCase_         =     'nllb-moe'
      lowerCamelCase_         =     ['past_key_values']
      lowerCamelCase_         =     {'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}




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






         """simple docstring"""






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

         a__ :List[Any]						  =    router_ignore_padding_tokens
         a__ :str						  =    batch_prioritized_routing
         a__ :List[Any]						  =    second_expert_policy
         a__ :Optional[Any]						  =    normalize_router_prob_before_dropping
         a__ :Any						  =    moe_eval_capacity_token_fraction
         a__ :Union[str, Any]						  =    moe_token_dropout
         a__ :List[str]						  =    output_router_logits
         super().__init__(
             pad_token_id=__A   ,     bos_token_id=__A   ,     eos_token_id=__A   ,     is_encoder_decoder=__A   ,     decoder_start_token_id=__A   ,     **__A   ,     )






def 				lowerCamelCase__	(      a	:   int	,  a	:   int				)    ->	Any:





			"""simple docstring"""
			# "extended trapezoidal rule"
			# int(f) = dx/2 * (f1 + 2f2 + ... + fn)
			a__ :Optional[int]						  =    (boundary[1] - boundary[0]) / steps
			a__ :str						  =    boundary[0]
			a__ :Optional[int]						  =    boundary[1]
			a__ :str						  =    make_points(a	,  a	,  a				)
			a__ :Any						  =    0.0
			y += (h / 2.0) * f(a				)
			for i in x_i:
						# print(i)
						y += h * f(a				)
			y += (h / 2.0) * f(a				)
			return y


def 				lowerCamelCase__	(      a	:   Any	,  a	:   str	,  a	:   Dict				)    ->	int:





			"""simple docstring"""
			a__ :Union[str, Any]						  =    a + h
			while x < (b - h):
						yield x
						a__ :str						  =    x + h


def 				lowerCamelCase__	(      a	:   Optional[int]				)    ->	List[Any]:  # enter your function here





			"""simple docstring"""
			a__ :Tuple						  =    (x - 0) * (x - 0)
			return y


def 				lowerCamelCase__	(      )    ->	List[str]:





			"""simple docstring"""
			a__ :Optional[Any]						  =    0.0  # Lower bound of integration
			a__ :Optional[Any]						  =    1.0  # Upper bound of integration
			a__ :List[str]						  =    1_0.0  # define number of steps or resolution
			a__ :int						  =    [a, b]  # define boundary of integration
			a__ :str						  =    method_a(a	,  a				)
			print(F'''y = {y}'''				)


if __name__ == "__main__":
		main()


