
from typing import List, Optional, Union

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


_lowercase											=    logging.get_logger(__name__)

_lowercase											=    {
    """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 			lowercase_		(      A       ):
       __lowerCamelCase				       =						"informer"
       __lowerCamelCase				       =						{
           "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						,       )						->    Tuple:
              # time series specific configuration
              SCREAMING_SNAKE_CASE_							:				Dict		=prediction_length
              SCREAMING_SNAKE_CASE_							:				Dict		=context_length or prediction_length
              SCREAMING_SNAKE_CASE_							:				str		=distribution_output
              SCREAMING_SNAKE_CASE_							:				str		=loss
              SCREAMING_SNAKE_CASE_							:				Dict		=input_size
              SCREAMING_SNAKE_CASE_							:				List[Any]		=num_time_features
              SCREAMING_SNAKE_CASE_							:				Optional[Any]		=lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
              SCREAMING_SNAKE_CASE_							:				Optional[int]		=scaling
              SCREAMING_SNAKE_CASE_							:				int		=num_dynamic_real_features
              SCREAMING_SNAKE_CASE_							:				Dict		=num_static_real_features
              SCREAMING_SNAKE_CASE_							:				int		=num_static_categorical_features

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

              # set embedding_dimension
              if embedding_dimension and num_static_categorical_features > 0:
                     if len(__A				) != 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_							:				Optional[Any]		=embedding_dimension
              else:
                     SCREAMING_SNAKE_CASE_							:				List[str]		=[min(50						,       (cat + 1) // 2				) for cat in self.cardinality]

              SCREAMING_SNAKE_CASE_							:				List[Any]		=num_parallel_samples

              # Transformer architecture configuration
              SCREAMING_SNAKE_CASE_							:				Union[str, Any]		=input_size * len(self.lags_sequence				) + self._number_of_features
              SCREAMING_SNAKE_CASE_							:				Optional[int]		=d_model
              SCREAMING_SNAKE_CASE_							:				Union[str, Any]		=encoder_attention_heads
              SCREAMING_SNAKE_CASE_							:				int		=decoder_attention_heads
              SCREAMING_SNAKE_CASE_							:				int		=encoder_ffn_dim
              SCREAMING_SNAKE_CASE_							:				Any		=decoder_ffn_dim
              SCREAMING_SNAKE_CASE_							:				int		=encoder_layers
              SCREAMING_SNAKE_CASE_							:				Optional[Any]		=decoder_layers

              SCREAMING_SNAKE_CASE_							:				Tuple		=dropout
              SCREAMING_SNAKE_CASE_							:				Any		=attention_dropout
              SCREAMING_SNAKE_CASE_							:				str		=activation_dropout
              SCREAMING_SNAKE_CASE_							:				List[Any]		=encoder_layerdrop
              SCREAMING_SNAKE_CASE_							:				str		=decoder_layerdrop

              SCREAMING_SNAKE_CASE_							:				List[Any]		=activation_function
              SCREAMING_SNAKE_CASE_							:				List[str]		=init_std

              SCREAMING_SNAKE_CASE_							:				Union[str, Any]		=use_cache

              # Informer
              SCREAMING_SNAKE_CASE_							:				Any		=attention_type
              SCREAMING_SNAKE_CASE_							:				Union[str, Any]		=sampling_factor
              SCREAMING_SNAKE_CASE_							:				Optional[int]		=distil

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





       @property
       def 	_snake_case				(    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_torch_available,
)


_lowercase											=    {
    """configuration_falcon""": ["""FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP""", """FalconConfig"""],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _lowercase											=    [
     """FALCON_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """FalconForCausalLM""",
     """FalconModel""",
     """FalconPreTrainedModel""",
     """FalconForSequenceClassification""",
     """FalconForTokenClassification""",
     """FalconForQuestionAnswering""",
 ]


if TYPE_CHECKING:
 from .configuration_falcon import FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP, FalconConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_falcon import (
      FALCON_PRETRAINED_MODEL_ARCHIVE_LIST,
      FalconForCausalLM,
      FalconForQuestionAnswering,
      FalconForSequenceClassification,
      FalconForTokenClassification,
      FalconModel,
      FalconPreTrainedModel,
  )


else:
 import sys

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