



'''simple docstring'''



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


lowerCAmelCase	:		Union[str, Any]				=   logging.get_logger(__name__)

lowerCAmelCase	:		Optional[int]				=   {
    '''facebook/nllb-moe-54B''': '''https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json''',
}






class 					UpperCAmelCase__	(		SCREAMING_SNAKE_CASE__ ):
					a      :     Tuple        =							"""nllb-moe"""
					a      :     Optional[int]        =							["""past_key_values"""]
					a      :     Any        =							{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}



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

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




'''simple docstring'''



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


lowerCAmelCase	:		Optional[Any]				=   logging.get_logger(__name__)

lowerCAmelCase	:		Optional[int]				=   {
    '''facebook/dpr-ctx_encoder-single-nq-base''': (
        '''https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-question_encoder-single-nq-base''': (
        '''https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-reader-single-nq-base''': (
        '''https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-ctx_encoder-multiset-base''': (
        '''https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-question_encoder-multiset-base''': (
        '''https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-reader-multiset-base''': (
        '''https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json'''
    ),
}






class 					UpperCAmelCase__	(		UpperCamelCase__ ):
					a      :     Optional[Any]        =							"""dpr"""



					def __init__(    self			,				UpperCamelCase=3_0522			,				UpperCamelCase=768			,				UpperCamelCase=12			,				UpperCamelCase=12			,				UpperCamelCase=3072			,				UpperCamelCase="gelu"			,				UpperCamelCase=0.1			,				UpperCamelCase=0.1			,				UpperCamelCase=512			,				UpperCamelCase=2			,				UpperCamelCase=0.02			,				UpperCamelCase=1E-12			,				UpperCamelCase=0			,				UpperCamelCase="absolute"			,				UpperCamelCase = 0			,				**UpperCamelCase			,				)     ->			Tuple:
						super().__init__(pad_token_id=UpperCamelCase			,				**UpperCamelCase     )

						__lowerCAmelCase												=  vocab_size
						__lowerCAmelCase												=  hidden_size
						__lowerCAmelCase												=  num_hidden_layers
						__lowerCAmelCase												=  num_attention_heads
						__lowerCAmelCase												=  hidden_act
						__lowerCAmelCase												=  intermediate_size
						__lowerCAmelCase												=  hidden_dropout_prob
						__lowerCAmelCase												=  attention_probs_dropout_prob
						__lowerCAmelCase												=  max_position_embeddings
						__lowerCAmelCase												=  type_vocab_size
						__lowerCAmelCase												=  initializer_range
						__lowerCAmelCase												=  layer_norm_eps
						__lowerCAmelCase												=  projection_dim
						__lowerCAmelCase												=  position_embedding_type