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


lowercase__	:Optional[int]										=					logging.get_logger(__name__)

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







class        lowercase	(      SCREAMING_SNAKE_CASE__	):
							lowercase_ : str       ='''nllb-moe'''
							lowercase_ : Optional[int]       =['''past_key_values''']
							lowercase_ : Any       ={'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}




							def __init__(       self     ,A__=1_2_8_1_1_2     ,A__=1_0_2_4     ,A__=1_2     ,A__=4_0_9_6     ,A__=1_6     ,A__=1_2     ,A__=4_0_9_6     ,A__=1_6     ,A__=0.05     ,A__=0.05     ,A__=True     ,A__=True     ,A__="relu"     ,A__=1_0_2_4     ,A__=0.1     ,A__=0.1     ,A__=0.0     ,A__=0.02     ,A__=2     ,A__=True     ,A__=False     ,A__="float32"     ,A__=False     ,A__=1_2_8     ,A__=6_4     ,A__=4     ,A__=4     ,A__=0.001     ,A__=0.001     ,A__="all"     ,A__=False     ,A__=False     ,A__=1.0     ,A__=0.2     ,A__=1     ,A__=0     ,A__=2     ,A__=False     ,**A__     ,):
												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=A__     ,bos_token_id=A__     ,eos_token_id=A__     ,is_encoder_decoder=A__     ,decoder_start_token_id=A__     ,**A__     ,)



from __future__ import annotations

from decimal import Decimal
from math import *  # noqa: F403

from sympy import diff



def  UpperCamelCase					(							lowerCAmelCase__				,    lowerCAmelCase__				,    lowerCAmelCase__ = 10**-10	):
					'''simple docstring'''
					lowercase					=		a
					while True:
										lowercase					=		Decimal(lowerCAmelCase__	) - (
										    Decimal(eval(lowerCAmelCase__	)	) / Decimal(eval(str(diff(lowerCAmelCase__	)	)	)	)  # noqa: S307
										)
										# This number dictates the accuracy of the answer
										if abs(eval(lowerCAmelCase__	)	) < precision:  # noqa: S307
															return float(lowerCAmelCase__	)


# Let's Execute
if __name__ == "__main__":
							# Find root of trigonometric function
							# Find value of pi
							print(F'The root of sin(x) = 0 is {newton_raphson("sin(x)", 2)}')
							# Find root of polynomial
							print(F'The root of x**2 - 5*x + 2 = 0 is {newton_raphson("x**2 - 5*x + 2", 0.4)}')
							# Find Square Root of 5
							print(F'The root of log(x) - 1 = 0 is {newton_raphson("log(x) - 1", 2)}')
							# Exponential Roots
							print(F'The root of exp(x) - 1 = 0 is {newton_raphson("exp(x) - 1", 0)}')




