

'''simple docstring'''

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


A_							    =				logging.get_logger(__name__)

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





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

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













'''simple docstring'''

def     __magic_name__							(				__UpperCAmelCase				,						__UpperCAmelCase   )    ->       str:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE   				=							(boundary[1] - boundary[0]) / steps
   __SCREAMING_SNAKE_CASE   				=							boundary[0]
   __SCREAMING_SNAKE_CASE   				=							boundary[1]
   __SCREAMING_SNAKE_CASE   				=							make_points(__UpperCAmelCase				,						__UpperCAmelCase				,						__UpperCAmelCase   )
   __SCREAMING_SNAKE_CASE   				=							0.0
   y += (h / 2.0) * f(__UpperCAmelCase   )
   for i in x_i:
      # print(i)
      y += h * f(__UpperCAmelCase   )
   y += (h / 2.0) * f(__UpperCAmelCase   )
   return y

def     __magic_name__							(				__UpperCAmelCase				,						__UpperCAmelCase				,						__UpperCAmelCase   )    ->       Optional[Any]:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE   				=							a + h
   while x < (b - h):
      yield x
      __SCREAMING_SNAKE_CASE   				=							x + h

def     __magic_name__							(				__UpperCAmelCase   )    ->       int:  # enter your function here

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE   				=							(x - 0) * (x - 0)
   return y

def     __magic_name__							(				)    ->       Tuple:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE   				=							0.0  # Lower bound of integration
   __SCREAMING_SNAKE_CASE   				=							1.0  # Upper bound of integration
   __SCREAMING_SNAKE_CASE   				=							1_0.0  # define number of steps or resolution
   __SCREAMING_SNAKE_CASE   				=							[a, b]  # define boundary of integration
   __SCREAMING_SNAKE_CASE   				=							method_a(__UpperCAmelCase				,						__UpperCAmelCase   )
   print(f"""y = {y}"""   )


if __name__ == "__main__":
    main()





