






"""simple docstring"""







from typing import List, Optional

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


_lowerCAmelCase            =	logging.get_logger(__name__)

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


class      UpperCamelCase		(SCREAMING_SNAKE_CASE__     ):
						_SCREAMING_SNAKE_CASE  : Tuple												=		'''autoformer'''
						_SCREAMING_SNAKE_CASE  : Union[str, Any]												=		{
						    '''hidden_size''': '''d_model''',
						    '''num_attention_heads''': '''encoder_attention_heads''',
						    '''num_hidden_layers''': '''encoder_layers''',
						}






						def __init__(		self  :Optional[int]			, __magic_name__  :Union[str, Any] = None			, __magic_name__  :List[Any] = None			, __magic_name__  :List[str] = "student_t"			, __magic_name__  :int = "nll"			, __magic_name__  :Any = 1			, __magic_name__  :Tuple = [1, 2, 3, 4, 5, 6, 7]			, __magic_name__  :int = True			, __magic_name__  :Tuple = 0			, __magic_name__  :Dict = 0			, __magic_name__  :int = 0			, __magic_name__  :Union[str, Any] = 0			, __magic_name__  :List[Any] = None			, __magic_name__  :Union[str, Any] = None			, __magic_name__  :Dict = 64			, __magic_name__  :Optional[Any] = 2			, __magic_name__  :Optional[int] = 2			, __magic_name__  :List[Any] = 2			, __magic_name__  :Optional[int] = 2			, __magic_name__  :Dict = 32			, __magic_name__  :Optional[Any] = 32			, __magic_name__  :str = "gelu"			, __magic_name__  :Tuple = 0.1			, __magic_name__  :int = 0.1			, __magic_name__  :Tuple = 0.1			, __magic_name__  :List[Any] = 0.1			, __magic_name__  :Optional[Any] = 0.1			, __magic_name__  :int = 100			, __magic_name__  :Any = 0.02			, __magic_name__  :List[Any] = True			, __magic_name__  :str=True			, __magic_name__  :List[Any] = 10			, __magic_name__  :Union[str, Any] = 25			, __magic_name__  :Optional[Any] = 3			, **__magic_name__  :List[str]			, )      ->Dict:
										# time series specific configuration
										lowercase    :      Dict       = prediction_length
										lowercase    :      Any       = context_length if context_length is not None else prediction_length
										lowercase    :      Any       = distribution_output
										lowercase    :      Dict       = loss
										lowercase    :      Any       = input_size
										lowercase    :      Any       = num_time_features
										lowercase    :      List[Any]       = lags_sequence
										lowercase    :      int       = scaling
										lowercase    :      str       = num_dynamic_real_features
										lowercase    :      Tuple       = num_static_real_features
										lowercase    :      Optional[Any]       = num_static_categorical_features
										if cardinality is not None 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    :      Union[str, Any]       = cardinality
										else:
														lowercase    :      List[Any]       = [0]
										if embedding_dimension is not None 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    :      int       = embedding_dimension
										else:
														lowercase    :      Optional[Any]       = [min(50			, (cat + 1) // 2				) for cat in self.cardinality]
										lowercase    :      Any       = num_parallel_samples

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

										lowercase    :      Dict       = dropout
										lowercase    :      Union[str, Any]       = attention_dropout
										lowercase    :      List[str]       = activation_dropout
										lowercase    :      Tuple       = encoder_layerdrop
										lowercase    :      Any       = decoder_layerdrop

										lowercase    :      int       = activation_function
										lowercase    :      List[str]       = init_std

										lowercase    :      int       = use_cache

										# Autoformer
										lowercase    :      List[Any]       = label_length
										lowercase    :      Optional[int]       = moving_average
										lowercase    :      Any       = autocorrelation_factor

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






						@property
						def      __snake_case      (		self  :Union[str, Any]				)      ->Dict:
										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 typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase      					={
    "configuration_clap": [
        "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST",
        "ClapAudioConfig",
        "ClapConfig",
        "ClapTextConfig",
    ],
    "processing_clap": ["ClapProcessor"],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase      					=[
          "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST",
          "ClapModel",
          "ClapPreTrainedModel",
          "ClapTextModel",
          "ClapTextModelWithProjection",
          "ClapAudioModel",
          "ClapAudioModelWithProjection",
      ]
      UpperCamelCase      					=["ClapFeatureExtractor"]

if TYPE_CHECKING:
      from .configuration_clap import (
          CLAP_PRETRAINED_MODEL_ARCHIVE_LIST,
          ClapAudioConfig,
          ClapConfig,
          ClapTextConfig,
      )
      from .processing_clap import ClapProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .feature_extraction_clap import ClapFeatureExtractor
            from .modeling_clap import (
                CLAP_PRETRAINED_MODEL_ARCHIVE_LIST,
                ClapAudioModel,
                ClapAudioModelWithProjection,
                ClapModel,
                ClapPreTrainedModel,
                ClapTextModel,
                ClapTextModelWithProjection,
            )


else:
      import sys

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






