

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


_UpperCAmelCase						:  Tuple									=			logging.get_logger(__name__)

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







class 					lowercase							(			lowercase_     ):
				__SCREAMING_SNAKE_CASE   :					Tuple			     =     '''nllb-moe'''
				__SCREAMING_SNAKE_CASE   :					Dict			     =     ['''past_key_values''']
				__SCREAMING_SNAKE_CASE   :					Optional[int]			     =     {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}




				def __init__(   self ,  snake_case=12_8112 ,  snake_case=1024 ,  snake_case=12 ,  snake_case=4096 ,  snake_case=16 ,  snake_case=12 ,  snake_case=4096 ,  snake_case=16 ,  snake_case=0.05 ,  snake_case=0.05 ,  snake_case=True ,  snake_case=True ,  snake_case="relu" ,  snake_case=1024 ,  snake_case=0.1 ,  snake_case=0.1 ,  snake_case=0.0 ,  snake_case=0.02 ,  snake_case=2 ,  snake_case=True ,  snake_case=False ,  snake_case="float32" ,  snake_case=False ,  snake_case=128 ,  snake_case=64 ,  snake_case=4 ,  snake_case=4 ,  snake_case=0.0_01 ,  snake_case=0.0_01 ,  snake_case="all" ,  snake_case=False ,  snake_case=False ,  snake_case=1.0 ,  snake_case=0.2 ,  snake_case=1 ,  snake_case=0 ,  snake_case=2 ,  snake_case=False ,  **snake_case ,  ):
											snake_case_     							=       vocab_size
											snake_case_     							=       max_position_embeddings
											snake_case_     							=       d_model
											snake_case_     							=       encoder_ffn_dim
											snake_case_     							=       encoder_layers
											snake_case_     							=       encoder_attention_heads
											snake_case_     							=       decoder_ffn_dim
											snake_case_     							=       decoder_layers
											snake_case_     							=       decoder_attention_heads
											snake_case_     							=       dropout
											snake_case_     							=       attention_dropout
											snake_case_     							=       activation_dropout
											snake_case_     							=       activation_function
											snake_case_     							=       init_std
											snake_case_     							=       encoder_layerdrop
											snake_case_     							=       decoder_layerdrop
											snake_case_     							=       use_cache
											snake_case_     							=       encoder_layers
											snake_case_     							=       scale_embedding  # scale factor will be sqrt(d_model) if True
											snake_case_     							=       router_z_loss_coef
											snake_case_     							=       router_aux_loss_coef
											snake_case_     							=       decoder_sparse_step
											snake_case_     							=       encoder_sparse_step
											snake_case_     							=       num_experts
											snake_case_     							=       expert_capacity
											snake_case_     							=       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}'''			)
											snake_case_     							=       router_dtype

											snake_case_     							=       router_ignore_padding_tokens
											snake_case_     							=       batch_prioritized_routing
											snake_case_     							=       second_expert_policy
											snake_case_     							=       normalize_router_prob_before_dropping
											snake_case_     							=       moe_eval_capacity_token_fraction
											snake_case_     							=       moe_token_dropout
											snake_case_     							=       output_router_logits
											super().__init__(
											    pad_token_id=snake_case ,  bos_token_id=snake_case ,  eos_token_id=snake_case ,  is_encoder_decoder=snake_case ,  decoder_start_token_id=snake_case ,  **snake_case ,  )







import argparse


_UpperCAmelCase						:  Union[str, Any]									=			"""docs/source/_static/js/custom.js"""





def    __lowerCamelCase      (					UpperCamelCase__ ):







							'''simple docstring'''






							with open(UpperCamelCase__  ,				encoding='utf-8'  ,				newline='\n' ) as f:
														snake_case_     							=       f.readlines()
							snake_case_     							=       0

							# First let's put the right version
							while not lines[index].startswith('const stableVersion =' ):
														index += 1
							snake_case_     							=       F'''const stableVersion = "v{version}"\n'''

							# Then update the dictionary
							while not lines[index].startswith('const versionMapping = {' ):
														index += 1

							# We go until the end
							while not lines[index].startswith('}' ):
														index += 1
							# We add the new version at the end
							lines[index - 1] += F'''    "v{version}": "v{version}",\n'''

							with open(UpperCamelCase__  ,				'w'  ,				encoding='utf-8'  ,				newline='\n' ) as f:
														f.writelines(UpperCamelCase__ )


if __name__ == "__main__":
					_UpperCAmelCase						:  int									=			argparse.ArgumentParser()
					parser.add_argument("""--version""", help="""Release version.""")
					_UpperCAmelCase						:  str									=			parser.parse_args()
					update_custom_js(args.version)




