
from typing import List, Optional, Union

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


_A   =     logging.get_logger(__name__)

_A   =     {
    "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 	_lowerCAmelCase					(	__a       ):
				_lowercase					='''informer'''
				_lowercase					={
				    '''hidden_size''': '''d_model''',
				    '''num_attention_heads''': '''encoder_attention_heads''',
				    '''num_hidden_layers''': '''encoder_layers''',
				}




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

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

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

							lowerCAmelCase_						=	num_parallel_samples

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

							lowerCAmelCase_						=	dropout
							lowerCAmelCase_						=	attention_dropout
							lowerCAmelCase_						=	activation_dropout
							lowerCAmelCase_						=	encoder_layerdrop
							lowerCAmelCase_						=	decoder_layerdrop

							lowerCAmelCase_						=	activation_function
							lowerCAmelCase_						=	init_std

							lowerCAmelCase_						=	use_cache

							# Informer
							lowerCAmelCase_						=	attention_type
							lowerCAmelCase_						=	sampling_factor
							lowerCAmelCase_						=	distil

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




				@property
				def      __a						(					self     )				->      int:
							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
							)





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_A   =     {
    "configuration_distilbert": [
        "DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "DistilBertConfig",
        "DistilBertOnnxConfig",
    ],
    "tokenization_distilbert": ["DistilBertTokenizer"],
}

try:
			if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A   =     ["DistilBertTokenizerFast"]

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A   =     [
			    "DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
			    "DistilBertForMaskedLM",
			    "DistilBertForMultipleChoice",
			    "DistilBertForQuestionAnswering",
			    "DistilBertForSequenceClassification",
			    "DistilBertForTokenClassification",
			    "DistilBertModel",
			    "DistilBertPreTrainedModel",
			]

try:
			if not is_tf_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A   =     [
			    "TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
			    "TFDistilBertForMaskedLM",
			    "TFDistilBertForMultipleChoice",
			    "TFDistilBertForQuestionAnswering",
			    "TFDistilBertForSequenceClassification",
			    "TFDistilBertForTokenClassification",
			    "TFDistilBertMainLayer",
			    "TFDistilBertModel",
			    "TFDistilBertPreTrainedModel",
			]

try:
			if not is_flax_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A   =     [
			    "FlaxDistilBertForMaskedLM",
			    "FlaxDistilBertForMultipleChoice",
			    "FlaxDistilBertForQuestionAnswering",
			    "FlaxDistilBertForSequenceClassification",
			    "FlaxDistilBertForTokenClassification",
			    "FlaxDistilBertModel",
			    "FlaxDistilBertPreTrainedModel",
			]


if TYPE_CHECKING:
			from .configuration_distilbert import (
			    DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
			    DistilBertConfig,
			    DistilBertOnnxConfig,
			)
			from .tokenization_distilbert import DistilBertTokenizer

			try:
						if not is_tokenizers_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .tokenization_distilbert_fast import DistilBertTokenizerFast

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_distilbert import (
						    DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    DistilBertForMaskedLM,
						    DistilBertForMultipleChoice,
						    DistilBertForQuestionAnswering,
						    DistilBertForSequenceClassification,
						    DistilBertForTokenClassification,
						    DistilBertModel,
						    DistilBertPreTrainedModel,
						)

			try:
						if not is_tf_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_tf_distilbert import (
						    TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    TFDistilBertForMaskedLM,
						    TFDistilBertForMultipleChoice,
						    TFDistilBertForQuestionAnswering,
						    TFDistilBertForSequenceClassification,
						    TFDistilBertForTokenClassification,
						    TFDistilBertMainLayer,
						    TFDistilBertModel,
						    TFDistilBertPreTrainedModel,
						)

			try:
						if not is_flax_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_flax_distilbert import (
						    FlaxDistilBertForMaskedLM,
						    FlaxDistilBertForMultipleChoice,
						    FlaxDistilBertForQuestionAnswering,
						    FlaxDistilBertForSequenceClassification,
						    FlaxDistilBertForTokenClassification,
						    FlaxDistilBertModel,
						    FlaxDistilBertPreTrainedModel,
						)

else:
			import sys

			_A   =     _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)



