





from typing import List, Optional, Union

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


A_      =      logging.get_logger(__name__)

A_      =      {
    "huggingface/time-series-transformer-tourism-monthly": (
        "https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json"
    ),
    # See all TimeSeriesTransformer models at https://huggingface.co/models?filter=time_series_transformer
}






class      __lowercase					(    _A    ):
						lowercase					 =     'time_series_transformer'
						lowercase					 =     {
						    'hidden_size': 'd_model',
						    'num_attention_heads': 'encoder_attention_heads',
						    'num_hidden_layers': 'encoder_layers',
						}

						def __init__(	self				:      List[str]							,							__lowerCamelCase				:      Optional[int] = None							,							__lowerCamelCase				:      Optional[int] = None							,							__lowerCamelCase				:      str = "student_t"							,							__lowerCamelCase				:      str = "nll"							,							__lowerCamelCase				:      int = 1							,							__lowerCamelCase				:      List[int] = [1, 2, 3, 4, 5, 6, 7]							,							__lowerCamelCase				:      Optional[Union[str, bool]] = "mean"							,							__lowerCamelCase				:      int = 0							,							__lowerCamelCase				:      int = 0							,							__lowerCamelCase				:      int = 0							,							__lowerCamelCase				:      int = 0							,							__lowerCamelCase				:      Optional[List[int]] = None							,							__lowerCamelCase				:      Optional[List[int]] = None							,							__lowerCamelCase				:      int = 32							,							__lowerCamelCase				:      int = 32							,							__lowerCamelCase				:      int = 2							,							__lowerCamelCase				:      int = 2							,							__lowerCamelCase				:      int = 2							,							__lowerCamelCase				:      int = 2							,							__lowerCamelCase				:      bool = True							,							__lowerCamelCase				:      str = "gelu"							,							__lowerCamelCase				:      int = 64							,							__lowerCamelCase				:      float = 0.1							,							__lowerCamelCase				:      float = 0.1							,							__lowerCamelCase				:      float = 0.1							,							__lowerCamelCase				:      float = 0.1							,							__lowerCamelCase				:      float = 0.1							,							__lowerCamelCase				:      int = 1_00							,							__lowerCamelCase				:      float = 0.02							,							__lowerCamelCase				:      Any=True							,							**__lowerCamelCase				:      int							,							)							->		List[Any]:


									'''simple docstring'''

									lowercase							=		prediction_length
									lowercase							=		context_length or prediction_length
									lowercase							=		distribution_output
									lowercase							=		loss
									lowercase							=		input_size
									lowercase							=		num_time_features
									lowercase							=		lags_sequence
									lowercase							=		scaling
									lowercase							=		num_dynamic_real_features
									lowercase							=		num_static_real_features
									lowercase							=		num_static_categorical_features
									if cardinality and num_static_categorical_features > 0:
												if len(__lowerCamelCase   ) != num_static_categorical_features:
															raise ValueError(
															    '''The cardinality should be a list of the same length as `num_static_categorical_features`'''   )
												lowercase							=		cardinality
									else:
												lowercase							=		[0]
									if embedding_dimension and num_static_categorical_features > 0:
												if len(__lowerCamelCase   ) != num_static_categorical_features:
															raise ValueError(
															    '''The embedding dimension should be a list of the same length as `num_static_categorical_features`'''   )
												lowercase							=		embedding_dimension
									else:
												lowercase							=		[min(50							,							(cat + 1) // 2   ) for cat in self.cardinality]
									lowercase							=		num_parallel_samples

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

									lowercase							=		dropout
									lowercase							=		attention_dropout
									lowercase							=		activation_dropout
									lowercase							=		encoder_layerdrop
									lowercase							=		decoder_layerdrop

									lowercase							=		activation_function
									lowercase							=		init_std

									lowercase							=		use_cache

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



						@property
						def        __a		(	self				:      List[str]   )							->		int:


									'''simple docstring'''

									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,
)


A_      =      {
    "configuration_gpt_bigcode": ["GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTBigCodeConfig"],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_      =      [
						    "GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "GPTBigCodeForSequenceClassification",
						    "GPTBigCodeForTokenClassification",
						    "GPTBigCodeForCausalLM",
						    "GPTBigCodeModel",
						    "GPTBigCodePreTrainedModel",
						]

if TYPE_CHECKING:
						from .configuration_gpt_bigcode import GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTBigCodeConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_gpt_bigcode import (
												    GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST,
												    GPTBigCodeForCausalLM,
												    GPTBigCodeForSequenceClassification,
												    GPTBigCodeForTokenClassification,
												    GPTBigCodeModel,
												    GPTBigCodePreTrainedModel,
												)


else:
						import sys

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





