




import warnings

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


_snake_case										=       logging.get_logger(__name__)

_snake_case										=       {
    "xlnet-base-cased": "https://huggingface.co/xlnet-base-cased/resolve/main/config.json",
    "xlnet-large-cased": "https://huggingface.co/xlnet-large-cased/resolve/main/config.json",
}







class 						lowercase							(   UpperCamelCase__		):
     _a							 =						"xlnet"
     _a							 =						["mems"]
     _a							 =						{
         "n_token": "vocab_size",  # Backward compatibility
         "hidden_size": "d_model",
         "num_attention_heads": "n_head",
         "num_hidden_layers": "n_layer",
     }

     def __init__(  self		,     _a=3_2000		,     _a=1024		,     _a=24		,     _a=16		,     _a=4096		,     _a="gelu"		,     _a=True		,     _a="bi"		,     _a=0.02		,     _a=1e-12		,     _a=0.1		,     _a=512		,     _a=None		,     _a=True		,     _a=False		,     _a=False		,     _a=-1		,     _a=False		,     _a="last"		,     _a=True		,     _a="tanh"		,     _a=0.1		,     _a=5		,     _a=5		,     _a=5		,     _a=1		,     _a=2		,     **_a		,     )						->							Optional[int]:
           _A							:     Tuple			=						vocab_size
           _A							:     int			=						d_model
           _A							:     int			=						n_layer
           _A							:     Union[str, Any]			=						n_head
           if d_model % n_head != 0:
                 raise ValueError(F'''\'d_model % n_head\' ({d_model % n_head}) should be equal to 0'''				)
           if "d_head" in kwargs:
                 if kwargs["d_head"] != d_model // n_head:
                       raise ValueError(
                           F'''`d_head` ({kwargs["d_head"]}) should be equal to `d_model // n_head` ({d_model // n_head})'''				)
           _A							:     Optional[int]			=						d_model // n_head
           _A							:     Optional[int]			=						ff_activation
           _A							:     Dict			=						d_inner
           _A							:     Union[str, Any]			=						untie_r
           _A							:     Any			=						attn_type

           _A							:     Optional[int]			=						initializer_range
           _A							:     Optional[Any]			=						layer_norm_eps

           _A							:     List[Any]			=						dropout
           _A							:     Optional[Any]			=						mem_len
           _A							:     Union[str, Any]			=						reuse_len
           _A							:     Tuple			=						bi_data
           _A							:     Optional[int]			=						clamp_len
           _A							:     Dict			=						same_length

           _A							:     Dict			=						summary_type
           _A							:     Optional[int]			=						summary_use_proj
           _A							:     Union[str, Any]			=						summary_activation
           _A							:     Optional[Any]			=						summary_last_dropout
           _A							:     str			=						start_n_top
           _A							:     List[Any]			=						end_n_top

           _A							:     List[str]			=						bos_token_id
           _A							:     List[Any]			=						pad_token_id
           _A							:     str			=						eos_token_id

           if "use_cache" in kwargs:
                 warnings.warn(
                     """The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`"""
                     """ instead."""		,     snake_case__		,     )
                 _A							:     Dict			=						kwargs["use_cache"]

           _A							:     str			=						use_mems_eval
           _A							:     str			=						use_mems_train
           super().__init__(pad_token_id=snake_case__		,     bos_token_id=snake_case__		,     eos_token_id=snake_case__		,     **snake_case__				)

     @property
     def 					a__	(  self				)						->							Optional[Any]:
           logger.info(F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''				)
           return -1



     @max_position_embeddings.setter
     def 					a__	(  self		,     _a				)						->							List[str]:
           raise NotImplementedError(
               F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''				)





"""simple docstring"""







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


lowerCAmelCase__      				=   logging.get_logger(__name__)

lowerCAmelCase__      				=   {
    '''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       SCREAMING_SNAKE_CASE__				(		lowercase				):
       """simple docstring"""


       a  :				int   ="dpr"

       def __init__(						self		,     snake_case__=30_522		,     snake_case__=768		,     snake_case__=12		,     snake_case__=12		,     snake_case__=3_072		,     snake_case__="gelu"		,     snake_case__=0.1		,     snake_case__=0.1		,     snake_case__=512		,     snake_case__=2		,     snake_case__=0.02		,     snake_case__=1e-12		,     snake_case__=0		,     snake_case__="absolute"		,     snake_case__ = 0		,     **snake_case__		,     ):






         """simple docstring"""





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

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





