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


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

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


class       __lowercase      (	__SCREAMING_SNAKE_CASE  ):







     '''simple docstring'''
     SCREAMING_SNAKE_CASE   						=				"nllb-moe"
     SCREAMING_SNAKE_CASE   						=				["past_key_values"]
     SCREAMING_SNAKE_CASE   						=				{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}




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


         """simple docstring"""



         __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=_a ,	bos_token_id=_a ,	eos_token_id=_a ,	is_encoder_decoder=_a ,	decoder_start_token_id=_a ,	**_a ,	)












def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			List[Any]			,				__lowercase   :			Dict			,				__lowercase   :			str    )						->      Dict:





    """simple docstring"""

    if n == 0:
        return 1

    elif n % 2 == 1:
        return (binary_exponentiation(__lowercase			,				n - 1			,				__lowercase    ) * a) % mod

    else:
        __A         =	binary_exponentiation(__lowercase			,				n / 2			,				__lowercase    )
        return (b * b) % mod


# a prime number
__a      :       Union[str, Any]				  =   701

__a      :       Dict				  =   1000000000
__a      :       Union[str, Any]				  =   10

# using binary exponentiation function, O(log(p)):
print((a / b) % p == (a * binary_exponentiation(b, p - 2, p)) % p)






print((a / b) % p == (a * b ** (p - 2)) % p)




