



"""simple docstring"""







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


lowercase__		:				Dict          =	logging.get_logger(__name__)

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







class       UpperCamelCase__   (	lowercase_  ):




      """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				:      Optional[Any]    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=1_2_8_1_1_2    ,			SCREAMING_SNAKE_CASE_				:      str=1_0_2_4    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=1_2    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=4_0_9_6    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=1_6    ,			SCREAMING_SNAKE_CASE_				:      Tuple=1_2    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=4_0_9_6    ,			SCREAMING_SNAKE_CASE_				:      List[str]=1_6    ,			SCREAMING_SNAKE_CASE_				:      int=0.05    ,			SCREAMING_SNAKE_CASE_				:      Any=0.05    ,			SCREAMING_SNAKE_CASE_				:      Optional[Any]=True    ,			SCREAMING_SNAKE_CASE_				:      Tuple=True    ,			SCREAMING_SNAKE_CASE_				:      Optional[int]="relu"    ,			SCREAMING_SNAKE_CASE_				:      Optional[int]=1_0_2_4    ,			SCREAMING_SNAKE_CASE_				:      str=0.1    ,			SCREAMING_SNAKE_CASE_				:      Optional[Any]=0.1    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=0.0    ,			SCREAMING_SNAKE_CASE_				:      Dict=0.02    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=2    ,			SCREAMING_SNAKE_CASE_				:      Optional[Any]=True    ,			SCREAMING_SNAKE_CASE_				:      int=False    ,			SCREAMING_SNAKE_CASE_				:      List[Any]="float32"    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=False    ,			SCREAMING_SNAKE_CASE_				:      Optional[Any]=1_2_8    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=6_4    ,			SCREAMING_SNAKE_CASE_				:      Dict=4    ,			SCREAMING_SNAKE_CASE_				:      int=4    ,			SCREAMING_SNAKE_CASE_				:      Dict=0.0_01    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=0.0_01    ,			SCREAMING_SNAKE_CASE_				:      List[Any]="all"    ,			SCREAMING_SNAKE_CASE_				:      Optional[int]=False    ,			SCREAMING_SNAKE_CASE_				:      List[str]=False    ,			SCREAMING_SNAKE_CASE_				:      List[str]=1.0    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=0.2    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=1    ,			SCREAMING_SNAKE_CASE_				:      List[str]=0    ,			SCREAMING_SNAKE_CASE_				:      str=2    ,			SCREAMING_SNAKE_CASE_				:      Tuple=False    ,			**SCREAMING_SNAKE_CASE_				:      Optional[int]    ,			):
        lowerCAmelCase_   :				List[str]								= vocab_size
        lowerCAmelCase_   :				Union[str, Any]								= max_position_embeddings
        lowerCAmelCase_   :				Dict								= d_model
        lowerCAmelCase_   :				Optional[int]								= encoder_ffn_dim
        lowerCAmelCase_   :				Optional[int]								= encoder_layers
        lowerCAmelCase_   :				Union[str, Any]								= encoder_attention_heads
        lowerCAmelCase_   :				Tuple								= decoder_ffn_dim
        lowerCAmelCase_   :				List[str]								= decoder_layers
        lowerCAmelCase_   :				List[str]								= decoder_attention_heads
        lowerCAmelCase_   :				List[str]								= dropout
        lowerCAmelCase_   :				Optional[Any]								= attention_dropout
        lowerCAmelCase_   :				Union[str, Any]								= activation_dropout
        lowerCAmelCase_   :				List[Any]								= activation_function
        lowerCAmelCase_   :				List[str]								= init_std
        lowerCAmelCase_   :				Optional[int]								= encoder_layerdrop
        lowerCAmelCase_   :				Optional[int]								= decoder_layerdrop
        lowerCAmelCase_   :				Any								= use_cache
        lowerCAmelCase_   :				Optional[Any]								= encoder_layers
        lowerCAmelCase_   :				List[Any]								= scale_embedding  # scale factor will be sqrt(d_model) if True
        lowerCAmelCase_   :				Optional[Any]								= router_z_loss_coef
        lowerCAmelCase_   :				Union[str, Any]								= router_aux_loss_coef
        lowerCAmelCase_   :				Dict								= decoder_sparse_step
        lowerCAmelCase_   :				Dict								= encoder_sparse_step
        lowerCAmelCase_   :				List[str]								= num_experts
        lowerCAmelCase_   :				str								= expert_capacity
        lowerCAmelCase_   :				Optional[int]								= 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_   :				List[str]								= router_dtype

        lowerCAmelCase_   :				List[Any]								= router_ignore_padding_tokens
        lowerCAmelCase_   :				Optional[int]								= batch_prioritized_routing
        lowerCAmelCase_   :				List[Any]								= second_expert_policy
        lowerCAmelCase_   :				Union[str, Any]								= normalize_router_prob_before_dropping
        lowerCAmelCase_   :				Optional[int]								= moe_eval_capacity_token_fraction
        lowerCAmelCase_   :				Optional[Any]								= moe_token_dropout
        lowerCAmelCase_   :				Any								= 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"""







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


lowercase__		:				Tuple          =	logging.get_logger(__name__)

lowercase__		:				Any          =	{
    """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__   (	lowercase_  ):




      """simple docstring"""




      _SCREAMING_SNAKE_CASE  				=     """dpr"""



      def __init__(      self				:      List[Any]    ,			SCREAMING_SNAKE_CASE_				:      Tuple=3_0_5_2_2    ,			SCREAMING_SNAKE_CASE_				:      Any=7_6_8    ,			SCREAMING_SNAKE_CASE_				:      Dict=1_2    ,			SCREAMING_SNAKE_CASE_				:      List[str]=1_2    ,			SCREAMING_SNAKE_CASE_				:      int=3_0_7_2    ,			SCREAMING_SNAKE_CASE_				:      List[Any]="gelu"    ,			SCREAMING_SNAKE_CASE_				:      int=0.1    ,			SCREAMING_SNAKE_CASE_				:      int=0.1    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=5_1_2    ,			SCREAMING_SNAKE_CASE_				:      Optional[int]=2    ,			SCREAMING_SNAKE_CASE_				:      Optional[int]=0.02    ,			SCREAMING_SNAKE_CASE_				:      List[str]=1E-12    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=0    ,			SCREAMING_SNAKE_CASE_				:      Optional[int]="absolute"    ,			SCREAMING_SNAKE_CASE_				:      int = 0    ,			**SCREAMING_SNAKE_CASE_				:      Optional[int]    ,			):
        super().__init__(pad_token_id=SCREAMING_SNAKE_CASE_    ,			**SCREAMING_SNAKE_CASE_       )

        lowerCAmelCase_   :				Optional[int]								= vocab_size
        lowerCAmelCase_   :				Tuple								= hidden_size
        lowerCAmelCase_   :				int								= num_hidden_layers
        lowerCAmelCase_   :				str								= num_attention_heads
        lowerCAmelCase_   :				Any								= hidden_act
        lowerCAmelCase_   :				List[str]								= intermediate_size
        lowerCAmelCase_   :				int								= hidden_dropout_prob
        lowerCAmelCase_   :				Union[str, Any]								= attention_probs_dropout_prob
        lowerCAmelCase_   :				Tuple								= max_position_embeddings
        lowerCAmelCase_   :				List[str]								= type_vocab_size
        lowerCAmelCase_   :				str								= initializer_range
        lowerCAmelCase_   :				str								= layer_norm_eps
        lowerCAmelCase_   :				List[str]								= projection_dim
        lowerCAmelCase_   :				List[str]								= position_embedding_type





