



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


__UpperCAmelCase			  =			logging.get_logger(__name__)

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



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

          UpperCamelCase       :    Optional[Any]		      =      router_ignore_padding_tokens
          UpperCamelCase       :    int		      =      batch_prioritized_routing
          UpperCamelCase       :    Union[str, Any]		      =      second_expert_policy
          UpperCamelCase       :    List[Any]		      =      normalize_router_prob_before_dropping
          UpperCamelCase       :    List[str]		      =      moe_eval_capacity_token_fraction
          UpperCamelCase       :    List[str]		      =      moe_token_dropout
          UpperCamelCase       :    int		      =      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      lowerCamelCase_					(   __lowerCAmelCase							)				->   int:




						'''simple docstring'''



						if not isinstance(__lowerCAmelCase  ,       __lowerCAmelCase							):
												raise TypeError("only integers accepted as input"							)
						else:
												lowerCamelCase__   =str(abs(__lowerCAmelCase							)							)
												lowerCamelCase__   =[list(__lowerCAmelCase							) for char in range(len(__lowerCAmelCase							)							)]
												for index in range(len(__lowerCAmelCase							)							):
																		num_transpositions[index].pop(__lowerCAmelCase							)
												return max(
												    int("".join(list(__lowerCAmelCase							)							)							) for transposition in num_transpositions							)


if __name__ == "__main__":
	__import__('doctest').testmod()


