




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


UpperCAmelCase_		:					Dict          =  logging.get_logger(__name__)

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




class 		__A   (      UpperCamelCase__      ):
						UpperCamelCase      =       """nllb-moe"""
						UpperCamelCase      =       ["""past_key_values"""]
						UpperCamelCase      =       {"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}

						def __init__(		self :str     ,			__snake_case :str=12_81_12     ,			__snake_case :str=10_24     ,			__snake_case :List[Any]=12     ,			__snake_case :Union[str, Any]=40_96     ,			__snake_case :Any=16     ,			__snake_case :Union[str, Any]=12     ,			__snake_case :int=40_96     ,			__snake_case :List[Any]=16     ,			__snake_case :Optional[int]=0.05     ,			__snake_case :Tuple=0.05     ,			__snake_case :Dict=True     ,			__snake_case :Optional[int]=True     ,			__snake_case :str="relu"     ,			__snake_case :List[str]=10_24     ,			__snake_case :Union[str, Any]=0.1     ,			__snake_case :List[Any]=0.1     ,			__snake_case :int=0.0     ,			__snake_case :int=0.02     ,			__snake_case :Union[str, Any]=2     ,			__snake_case :Union[str, Any]=True     ,			__snake_case :Optional[int]=False     ,			__snake_case :Any="float32"     ,			__snake_case :Union[str, Any]=False     ,			__snake_case :Tuple=1_28     ,			__snake_case :str=64     ,			__snake_case :Dict=4     ,			__snake_case :Tuple=4     ,			__snake_case :Optional[Any]=0.001     ,			__snake_case :Optional[Any]=0.001     ,			__snake_case :List[Any]="all"     ,			__snake_case :int=False     ,			__snake_case :List[Any]=False     ,			__snake_case :Optional[int]=1.0     ,			__snake_case :List[str]=0.2     ,			__snake_case :int=1     ,			__snake_case :Dict=0     ,			__snake_case :List[str]=2     ,			__snake_case :Dict=False     ,			**__snake_case :Optional[Any]     ,			):
										'''simple docstring'''

										__magic_name__						:						Tuple										=vocab_size
										__magic_name__						:						Optional[Any]										=max_position_embeddings
										__magic_name__						:						List[Any]										=d_model
										__magic_name__						:						Union[str, Any]										=encoder_ffn_dim
										__magic_name__						:						List[Any]										=encoder_layers
										__magic_name__						:						Optional[int]										=encoder_attention_heads
										__magic_name__						:						Optional[Any]										=decoder_ffn_dim
										__magic_name__						:						List[str]										=decoder_layers
										__magic_name__						:						Any										=decoder_attention_heads
										__magic_name__						:						int										=dropout
										__magic_name__						:						Any										=attention_dropout
										__magic_name__						:						Optional[Any]										=activation_dropout
										__magic_name__						:						int										=activation_function
										__magic_name__						:						str										=init_std
										__magic_name__						:						Optional[int]										=encoder_layerdrop
										__magic_name__						:						str										=decoder_layerdrop
										__magic_name__						:						Optional[int]										=use_cache
										__magic_name__						:						Union[str, Any]										=encoder_layers
										__magic_name__						:						int										=scale_embedding  # scale factor will be sqrt(d_model) if True
										__magic_name__						:						Any										=router_z_loss_coef
										__magic_name__						:						Tuple										=router_aux_loss_coef
										__magic_name__						:						Optional[Any]										=decoder_sparse_step
										__magic_name__						:						Dict										=encoder_sparse_step
										__magic_name__						:						List[Any]										=num_experts
										__magic_name__						:						Tuple										=expert_capacity
										__magic_name__						:						Union[str, Any]										=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}"			)
										__magic_name__						:						str										=router_dtype

										__magic_name__						:						Union[str, Any]										=router_ignore_padding_tokens
										__magic_name__						:						Dict										=batch_prioritized_routing
										__magic_name__						:						Optional[Any]										=second_expert_policy
										__magic_name__						:						Tuple										=normalize_router_prob_before_dropping
										__magic_name__						:						Any										=moe_eval_capacity_token_fraction
										__magic_name__						:						List[str]										=moe_token_dropout
										__magic_name__						:						str										=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     ,			)








"""simple docstring"""






UpperCamelCase__				:Tuple			   =	frozenset(
    [
        """prompt""",
        """height""",
        """width""",
        """guidance_scale""",
        """negative_prompt""",
        """prompt_embeds""",
        """negative_prompt_embeds""",
        """cross_attention_kwargs""",
    ]
)

UpperCamelCase__				:List[str]			   =	frozenset(["""prompt""", """negative_prompt"""])

UpperCamelCase__				:Tuple			   =	frozenset([])

UpperCamelCase__				:Union[str, Any]			   =	frozenset(["""image"""])

UpperCamelCase__				:str			   =	frozenset(
    [
        """image""",
        """height""",
        """width""",
        """guidance_scale""",
    ]
)

UpperCamelCase__				:Any			   =	frozenset(["""image"""])

UpperCamelCase__				:Optional[int]			   =	frozenset(
    [
        """prompt""",
        """image""",
        """height""",
        """width""",
        """guidance_scale""",
        """negative_prompt""",
        """prompt_embeds""",
        """negative_prompt_embeds""",
    ]
)

UpperCamelCase__				:int			   =	frozenset(["""prompt""", """image""", """negative_prompt"""])

UpperCamelCase__				:Tuple			   =	frozenset(
    [
        # Text guided image variation with an image mask
        """prompt""",
        """image""",
        """mask_image""",
        """height""",
        """width""",
        """guidance_scale""",
        """negative_prompt""",
        """prompt_embeds""",
        """negative_prompt_embeds""",
    ]
)

UpperCamelCase__				:Any			   =	frozenset(["""prompt""", """image""", """mask_image""", """negative_prompt"""])

UpperCamelCase__				:Dict			   =	frozenset(
    [
        # image variation with an image mask
        """image""",
        """mask_image""",
        """height""",
        """width""",
        """guidance_scale""",
    ]
)

UpperCamelCase__				:Dict			   =	frozenset(["""image""", """mask_image"""])

UpperCamelCase__				:Tuple			   =	frozenset(
    [
        """example_image""",
        """image""",
        """mask_image""",
        """height""",
        """width""",
        """guidance_scale""",
    ]
)

UpperCamelCase__				:List[str]			   =	frozenset(["""example_image""", """image""", """mask_image"""])

UpperCamelCase__				:List[str]			   =	frozenset(["""class_labels"""])

UpperCamelCase__				:Union[str, Any]			   =	frozenset(["""class_labels"""])

UpperCamelCase__				:Any			   =	frozenset(["""batch_size"""])

UpperCamelCase__				:Optional[Any]			   =	frozenset([])

UpperCamelCase__				:Optional[Any]			   =	frozenset(["""batch_size"""])

UpperCamelCase__				:Optional[int]			   =	frozenset([])

UpperCamelCase__				:str			   =	frozenset(
    [
        """prompt""",
        """audio_length_in_s""",
        """guidance_scale""",
        """negative_prompt""",
        """prompt_embeds""",
        """negative_prompt_embeds""",
        """cross_attention_kwargs""",
    ]
)

UpperCamelCase__				:Union[str, Any]			   =	frozenset(["""prompt""", """negative_prompt"""])
UpperCamelCase__				:Tuple			   =	frozenset(["""input_tokens"""])

UpperCamelCase__				:int			   =	frozenset(["""input_tokens"""])

