
'''simple docstring'''
from typing import Callable, Optional, Union

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


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

A__   :		Dict 		={
    'microsoft/xprophetnet-large-wiki100-cased': (
        'https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json'
    ),
}







class  __A				( _SCREAMING_SNAKE_CASE			):
 lowerCamelCase				       ='''xlm-prophetnet'''
 lowerCamelCase				       =['''past_key_values''']
 lowerCamelCase				       ={
     '''num_attention_heads''': '''num_encoder_attention_heads''',
 }
 def __init__(   self			:    List[Any]				,   lowerCamelCase			:    Optional[float] = 0.1				,   lowerCamelCase			:    Optional[Union[str, Callable]] = "gelu"				,   lowerCamelCase			:    Optional[int] = 3_05_22				,   lowerCamelCase			:    Optional[int] = 10_24				,   lowerCamelCase			:    Optional[int] = 40_96				,   lowerCamelCase			:    Optional[int] = 12				,   lowerCamelCase			:    Optional[int] = 16				,   lowerCamelCase			:    Optional[int] = 40_96				,   lowerCamelCase			:    Optional[int] = 12				,   lowerCamelCase			:    Optional[int] = 16				,   lowerCamelCase			:    Optional[float] = 0.1				,   lowerCamelCase			:    Optional[float] = 0.1				,   lowerCamelCase			:    Optional[int] = 5_12				,   lowerCamelCase			:    Optional[float] = 0.02				,   lowerCamelCase			:    Optional[bool] = True				,   lowerCamelCase			:    Optional[bool] = True				,   lowerCamelCase			:    Optional[int] = 0				,   lowerCamelCase			:    Optional[int] = 2				,   lowerCamelCase			:    Optional[int] = 32				,   lowerCamelCase			:    Optional[int] = 1_28				,   lowerCamelCase			:    Optional[bool] = False				,   lowerCamelCase			:    Optional[float] = 0.0				,   lowerCamelCase			:    Optional[bool] = True				,   lowerCamelCase			:    Optional[int] = 0				,   lowerCamelCase			:    Optional[int] = 1				,   lowerCamelCase			:    Optional[int] = 2				,   **lowerCamelCase			:    List[Any]				,   ):



   """simple docstring"""





   __A		:     List[Any]												=		vocab_size
   __A		:     Union[str, Any]												=		hidden_size
   __A		:     int												=		encoder_ffn_dim
   __A		:     Optional[int]												=		num_encoder_layers
   __A		:     Any												=		num_encoder_attention_heads
   __A		:     Optional[int]												=		decoder_ffn_dim
   __A		:     Optional[Any]												=		num_decoder_layers
   __A		:     Any												=		num_decoder_attention_heads
   __A		:     List[str]												=		max_position_embeddings
   __A		:     Tuple												=		init_std  # Normal(0, this parameter)
   __A		:     str												=		activation_function

   # parameters for xlmprophetnet
   __A		:     Tuple												=		ngram
   __A		:     Dict												=		num_buckets
   __A		:     Optional[Any]												=		relative_max_distance
   __A		:     str												=		disable_ngram_loss
   __A		:     List[str]												=		eps

   # 3 Types of Dropout
   __A		:     int												=		attention_dropout
   __A		:     Union[str, Any]												=		activation_dropout
   __A		:     List[str]												=		dropout

   __A		:     List[str]												=		use_cache

   super().__init__(
       pad_token_id=lowerCamelCase				,   bos_token_id=lowerCamelCase				,   eos_token_id=lowerCamelCase				,   is_encoder_decoder=lowerCamelCase				,   add_cross_attention=lowerCamelCase				,   decoder_start_token_id=lowerCamelCase				,   **lowerCamelCase				,   )
 @property
 def 		lowercase_(   self			:    Union[str, Any]       ):



   """simple docstring"""





   return self.num_encoder_layers + self.num_decoder_layers






 @num_hidden_layers.setter
 def 		lowercase_(   self			:    Any				,   lowerCamelCase			:    List[str]       ):



   """simple docstring"""





   raise NotImplementedError(
       """This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and"""
       """ `num_decoder_layers`."""       )

'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


A__   :		int 		=logging.get_logger(__name__)

A__   :		Union[str, 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  __A				( _SCREAMING_SNAKE_CASE			):
 lowerCamelCase				       ='''dpr'''
 def __init__(   self			:    Optional[int]				,   lowerCamelCase			:    Tuple=3_05_22				,   lowerCamelCase			:    List[str]=7_68				,   lowerCamelCase			:    Union[str, Any]=12				,   lowerCamelCase			:    Tuple=12				,   lowerCamelCase			:    Dict=30_72				,   lowerCamelCase			:    List[Any]="gelu"				,   lowerCamelCase			:    List[Any]=0.1				,   lowerCamelCase			:    Union[str, Any]=0.1				,   lowerCamelCase			:    Optional[Any]=5_12				,   lowerCamelCase			:    List[Any]=2				,   lowerCamelCase			:    int=0.02				,   lowerCamelCase			:    Union[str, Any]=1e-1_2				,   lowerCamelCase			:    int=0				,   lowerCamelCase			:    List[str]="absolute"				,   lowerCamelCase			:    int = 0				,   **lowerCamelCase			:    List[Any]				,   ):



   """simple docstring"""





   super().__init__(pad_token_id=lowerCamelCase				,   **lowerCamelCase       )

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



