



"""simple docstring"""





from typing import List, Optional

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


A   =       logging.get_logger(__name__)

A   =       {
    """huggingface/autoformer-tourism-monthly""": """https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json""",
}



class      a__				(	__magic_name__   ):
			lowercase_    =	"autoformer"
			lowercase_    =	{
			    "hidden_size": "d_model",
			    "num_attention_heads": "encoder_attention_heads",
			    "num_hidden_layers": "encoder_layers",
			}


			def __init__(      self      :    int      ,  UpperCamelCase_      :    Optional[int] = None      ,  UpperCamelCase_      :    Optional[int] = None      ,  UpperCamelCase_      :    str = "student_t"      ,  UpperCamelCase_      :    str = "nll"      ,  UpperCamelCase_      :    int = 1      ,  UpperCamelCase_      :    List[int] = [1, 2, 3, 4, 5, 6, 7]      ,  UpperCamelCase_      :    bool = True      ,  UpperCamelCase_      :    int = 0      ,  UpperCamelCase_      :    int = 0      ,  UpperCamelCase_      :    int = 0      ,  UpperCamelCase_      :    int = 0      ,  UpperCamelCase_      :    Optional[List[int]] = None      ,  UpperCamelCase_      :    Optional[List[int]] = None      ,  UpperCamelCase_      :    int = 64      ,  UpperCamelCase_      :    int = 2      ,  UpperCamelCase_      :    int = 2      ,  UpperCamelCase_      :    int = 2      ,  UpperCamelCase_      :    int = 2      ,  UpperCamelCase_      :    int = 32      ,  UpperCamelCase_      :    int = 32      ,  UpperCamelCase_      :    str = "gelu"      ,  UpperCamelCase_      :    float = 0.1      ,  UpperCamelCase_      :    float = 0.1      ,  UpperCamelCase_      :    float = 0.1      ,  UpperCamelCase_      :    float = 0.1      ,  UpperCamelCase_      :    float = 0.1      ,  UpperCamelCase_      :    int = 100      ,  UpperCamelCase_      :    float = 0.02      ,  UpperCamelCase_      :    bool = True      ,  UpperCamelCase_      :    List[Any]=True      ,  UpperCamelCase_      :    int = 10      ,  UpperCamelCase_      :    int = 25      ,  UpperCamelCase_      :    int = 3      ,  **UpperCamelCase_      :    int      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: Optional[int]		=					prediction_length
						__UpperCAmelCase	: int		=					context_length if context_length is not None else prediction_length
						__UpperCAmelCase	: int		=					distribution_output
						__UpperCAmelCase	: Tuple		=					loss
						__UpperCAmelCase	: Dict		=					input_size
						__UpperCAmelCase	: Union[str, Any]		=					num_time_features
						__UpperCAmelCase	: str		=					lags_sequence
						__UpperCAmelCase	: Optional[int]		=					scaling
						__UpperCAmelCase	: str		=					num_dynamic_real_features
						__UpperCAmelCase	: str		=					num_static_real_features
						__UpperCAmelCase	: str		=					num_static_categorical_features
						if cardinality is not None 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`")
									__UpperCAmelCase	: Optional[int]		=					cardinality
						else:
									__UpperCAmelCase	: List[str]		=					[0]
						if embedding_dimension is not None 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`")
									__UpperCAmelCase	: List[Any]		=					embedding_dimension
						else:
									__UpperCAmelCase	: List[Any]		=					[min(50      ,  (cat + 1) // 2) for cat in self.cardinality]
						__UpperCAmelCase	: List[str]		=					num_parallel_samples

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

						__UpperCAmelCase	: Optional[int]		=					dropout
						__UpperCAmelCase	: Optional[Any]		=					attention_dropout
						__UpperCAmelCase	: Optional[Any]		=					activation_dropout
						__UpperCAmelCase	: Union[str, Any]		=					encoder_layerdrop
						__UpperCAmelCase	: Any		=					decoder_layerdrop

						__UpperCAmelCase	: str		=					activation_function
						__UpperCAmelCase	: Optional[Any]		=					init_std

						__UpperCAmelCase	: int		=					use_cache

						# Autoformer
						__UpperCAmelCase	: Optional[Any]		=					label_length
						__UpperCAmelCase	: Tuple		=					moving_average
						__UpperCAmelCase	: str		=					autocorrelation_factor

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


			@property
			def       a_     (      self      :    Dict):


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








"""simple docstring"""





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


A   =       logging.get_logger(__name__)

A   =       {
    """bigcode/gpt_bigcode-santacoder""": """https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json""",
}



class      a__				(	__magic_name__   ):
			lowercase_    =	"gpt_bigcode"
			lowercase_    =	["past_key_values"]
			lowercase_    =	{
			    "hidden_size": "n_embd",
			    "max_position_embeddings": "n_positions",
			    "num_attention_heads": "n_head",
			    "num_hidden_layers": "n_layer",
			}


			def __init__(      self      :    Any      ,  UpperCamelCase_      :    Tuple=50257      ,  UpperCamelCase_      :    Dict=1024      ,  UpperCamelCase_      :    Optional[Any]=768      ,  UpperCamelCase_      :    Optional[Any]=12      ,  UpperCamelCase_      :    Any=12      ,  UpperCamelCase_      :    Optional[int]=None      ,  UpperCamelCase_      :    List[Any]="gelu_pytorch_tanh"      ,  UpperCamelCase_      :    Optional[Any]=0.1      ,  UpperCamelCase_      :    Union[str, Any]=0.1      ,  UpperCamelCase_      :    Tuple=0.1      ,  UpperCamelCase_      :    Tuple=1e-5      ,  UpperCamelCase_      :    List[str]=0.02      ,  UpperCamelCase_      :    Dict=True      ,  UpperCamelCase_      :    Optional[int]=True      ,  UpperCamelCase_      :    str=50256      ,  UpperCamelCase_      :    Union[str, Any]=50256      ,  UpperCamelCase_      :    Dict=True      ,  UpperCamelCase_      :    List[str]=True      ,  UpperCamelCase_      :    Union[str, Any]=True      ,  **UpperCamelCase_      :    Union[str, Any]      ,  ):


						"""simple docstring"""




						__UpperCAmelCase	: Tuple		=					vocab_size
						__UpperCAmelCase	: Optional[int]		=					n_positions
						__UpperCAmelCase	: Tuple		=					n_embd
						__UpperCAmelCase	: str		=					n_layer
						__UpperCAmelCase	: Dict		=					n_head
						__UpperCAmelCase	: Optional[Any]		=					n_inner
						__UpperCAmelCase	: Optional[Any]		=					activation_function
						__UpperCAmelCase	: List[str]		=					resid_pdrop
						__UpperCAmelCase	: List[Any]		=					embd_pdrop
						__UpperCAmelCase	: Optional[Any]		=					attn_pdrop
						__UpperCAmelCase	: Dict		=					layer_norm_epsilon
						__UpperCAmelCase	: List[str]		=					initializer_range
						__UpperCAmelCase	: int		=					scale_attn_weights
						__UpperCAmelCase	: Tuple		=					use_cache
						__UpperCAmelCase	: List[Any]		=					attention_softmax_in_fpaa
						__UpperCAmelCase	: Any		=					scale_attention_softmax_in_fpaa
						__UpperCAmelCase	: str		=					multi_query

						__UpperCAmelCase	: int		=					bos_token_id
						__UpperCAmelCase	: str		=					eos_token_id

						super().__init__(bos_token_id=UpperCamelCase_      ,  eos_token_id=UpperCamelCase_      ,  **UpperCamelCase_)


