






from typing import List, Optional, Union

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


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

a_						:  List[str]									=			{
    """huggingface/informer-tourism-monthly""": (
        """https://huggingface.co/huggingface/informer-tourism-monthly/resolve/main/config.json"""
    ),
    # See all Informer models at https://huggingface.co/models?filter=informer
}

class 						_snake_case     (     lowercase_    ):
			_lowercase						:			List[str]	   =							'''informer'''
			_lowercase						:			Union[str, Any]	   =							{
			    '''hidden_size''': '''d_model''',
			    '''num_attention_heads''': '''encoder_attention_heads''',
			    '''num_hidden_layers''': '''encoder_layers''',
			}






			def __init__(				self						,    a = None						,    a = None						,    a = "student_t"						,    a = "nll"						,    a = 1						,    a = None						,    a = "mean"						,    a = 0						,    a = 0						,    a = 0						,    a = 0						,    a = None						,    a = None						,    a = 64						,    a = 32						,    a = 32						,    a = 2						,    a = 2						,    a = 2						,    a = 2						,    a = True						,    a = "gelu"						,    a = 0.05						,    a = 0.1						,    a = 0.1						,    a = 0.1						,    a = 0.1						,    a = 100						,    a = 0.02						,    a=True						,    a = "prob"						,    a = 5						,    a = True						,    **a						,    )					->				Union[str, Any]:
						# time series specific configuration
						SCREAMING_SNAKE_CASE						 =       prediction_length
						SCREAMING_SNAKE_CASE						 =       context_length or prediction_length
						SCREAMING_SNAKE_CASE						 =       distribution_output
						SCREAMING_SNAKE_CASE						 =       loss
						SCREAMING_SNAKE_CASE						 =       input_size
						SCREAMING_SNAKE_CASE						 =       num_time_features
						SCREAMING_SNAKE_CASE						 =       lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
						SCREAMING_SNAKE_CASE						 =       scaling
						SCREAMING_SNAKE_CASE						 =       num_dynamic_real_features
						SCREAMING_SNAKE_CASE						 =       num_static_real_features
						SCREAMING_SNAKE_CASE						 =       num_static_categorical_features

						# set cardinality
						if cardinality and num_static_categorical_features > 0:
									if len(SCREAMING_SNAKE_CASE_) != num_static_categorical_features:
												raise ValueError(
												    'The cardinality should be a list of the same length as `num_static_categorical_features`')
									SCREAMING_SNAKE_CASE						 =       cardinality
						else:
									SCREAMING_SNAKE_CASE						 =       [0]

						# set embedding_dimension
						if embedding_dimension and num_static_categorical_features > 0:
									if len(SCREAMING_SNAKE_CASE_) != num_static_categorical_features:
												raise ValueError(
												    'The embedding dimension should be a list of the same length as `num_static_categorical_features`')
									SCREAMING_SNAKE_CASE						 =       embedding_dimension
						else:
									SCREAMING_SNAKE_CASE						 =       [min(50						,    (cat + 1) // 2) for cat in self.cardinality]

						SCREAMING_SNAKE_CASE						 =       num_parallel_samples

						# Transformer architecture configuration
						SCREAMING_SNAKE_CASE						 =       input_size * len(self.lags_sequence) + self._number_of_features
						SCREAMING_SNAKE_CASE						 =       d_model
						SCREAMING_SNAKE_CASE						 =       encoder_attention_heads
						SCREAMING_SNAKE_CASE						 =       decoder_attention_heads
						SCREAMING_SNAKE_CASE						 =       encoder_ffn_dim
						SCREAMING_SNAKE_CASE						 =       decoder_ffn_dim
						SCREAMING_SNAKE_CASE						 =       encoder_layers
						SCREAMING_SNAKE_CASE						 =       decoder_layers

						SCREAMING_SNAKE_CASE						 =       dropout
						SCREAMING_SNAKE_CASE						 =       attention_dropout
						SCREAMING_SNAKE_CASE						 =       activation_dropout
						SCREAMING_SNAKE_CASE						 =       encoder_layerdrop
						SCREAMING_SNAKE_CASE						 =       decoder_layerdrop

						SCREAMING_SNAKE_CASE						 =       activation_function
						SCREAMING_SNAKE_CASE						 =       init_std

						SCREAMING_SNAKE_CASE						 =       use_cache

						# Informer
						SCREAMING_SNAKE_CASE						 =       attention_type
						SCREAMING_SNAKE_CASE						 =       sampling_factor
						SCREAMING_SNAKE_CASE						 =       distil

						super().__init__(is_encoder_decoder=SCREAMING_SNAKE_CASE_						,    **SCREAMING_SNAKE_CASE_)







			@property
			def       SCREAMING_SNAKE_CASE__			(				self)					->				List[str]:
						return (
						    sum(self.embedding_dimension)
						    + self.num_dynamic_real_features
						    + self.num_time_features
						    + self.num_static_real_features
						    + self.input_size * 2  # the log1p(abs(loc)) and log(scale) features
						)









"""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





