






from typing import List, Optional

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


lowerCamelCase	:							List[str]				=logging.get_logger(__name__)

lowerCamelCase	:							Optional[int]				={
    '''huggingface/autoformer-tourism-monthly''': '''https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json''',
}





class 			__a  (    A__       ):
 _lowerCAmelCase       :       int        = '''autoformer'''
 _lowerCAmelCase       :       Any        = {
     '''hidden_size''': '''d_model''',
     '''num_attention_heads''': '''encoder_attention_heads''',
     '''num_hidden_layers''': '''encoder_layers''',
 }







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


      '''simple docstring'''






      UpperCamelCase__			:   Tuple       				=  prediction_length
      UpperCamelCase__			:   int       				=  context_length if context_length is not None else prediction_length
      UpperCamelCase__			:   Dict       				=  distribution_output
      UpperCamelCase__			:   Dict       				=  loss
      UpperCamelCase__			:   List[str]       				=  input_size
      UpperCamelCase__			:   Tuple       				=  num_time_features
      UpperCamelCase__			:   Tuple       				=  lags_sequence
      UpperCamelCase__			:   Tuple       				=  scaling
      UpperCamelCase__			:   Dict       				=  num_dynamic_real_features
      UpperCamelCase__			:   Union[str, Any]       				=  num_static_real_features
      UpperCamelCase__			:   Tuple       				=  num_static_categorical_features
      if cardinality is not None and num_static_categorical_features > 0:
           if len(SCREAMING_SNAKE_CASE						) != num_static_categorical_features:
                raise ValueError(
                    "The cardinality should be a list of the same length as `num_static_categorical_features`"						)
           UpperCamelCase__			:   Optional[Any]       				=  cardinality
      else:
           UpperCamelCase__			:   List[str]       				=  [0]
      if embedding_dimension is not None and num_static_categorical_features > 0:
           if len(SCREAMING_SNAKE_CASE						) != num_static_categorical_features:
                raise ValueError(
                    "The embedding dimension should be a list of the same length as `num_static_categorical_features`"						)
           UpperCamelCase__			:   List[str]       				=  embedding_dimension
      else:
           UpperCamelCase__			:   List[Any]       				=  [min(50							,   (cat + 1) // 2						) for cat in self.cardinality]
      UpperCamelCase__			:   Tuple       				=  num_parallel_samples

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

      UpperCamelCase__			:   List[str]       				=  dropout
      UpperCamelCase__			:   Dict       				=  attention_dropout
      UpperCamelCase__			:   List[Any]       				=  activation_dropout
      UpperCamelCase__			:   int       				=  encoder_layerdrop
      UpperCamelCase__			:   Union[str, Any]       				=  decoder_layerdrop

      UpperCamelCase__			:   Tuple       				=  activation_function
      UpperCamelCase__			:   Any       				=  init_std

      UpperCamelCase__			:   Any       				=  use_cache

      # Autoformer
      UpperCamelCase__			:   List[Any]       				=  label_length
      UpperCamelCase__			:   Dict       				=  moving_average
      UpperCamelCase__			:   Optional[Any]       				=  autocorrelation_factor

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







 @property
 def 					__lowercase					(		self					:   Tuple						):


      '''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 ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase	:							Optional[int]				=logging.get_logger(__name__)

lowerCamelCase	:							Dict				={
    '''facebook/s2t-wav2vec2-large-en-de''': (
        '''https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json'''
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}





class 			__a  (    A__       ):
 _lowerCAmelCase       :       Tuple        = '''speech_to_text_2'''
 _lowerCAmelCase       :       Dict        = ['''past_key_values''']
 _lowerCAmelCase       :       Any        = {'''num_attention_heads''': '''decoder_attention_heads''', '''hidden_size''': '''d_model'''}







 def __init__(		self					:   List[str]							,   SCREAMING_SNAKE_CASE					:   Union[str, Any]=1_00_00							,   SCREAMING_SNAKE_CASE					:   List[Any]=6							,   SCREAMING_SNAKE_CASE					:   List[Any]=20_48							,   SCREAMING_SNAKE_CASE					:   Dict=4							,   SCREAMING_SNAKE_CASE					:   List[Any]=0.0							,   SCREAMING_SNAKE_CASE					:   Optional[int]=True							,   SCREAMING_SNAKE_CASE					:   List[Any]="relu"							,   SCREAMING_SNAKE_CASE					:   Tuple=2_56							,   SCREAMING_SNAKE_CASE					:   List[str]=0.1							,   SCREAMING_SNAKE_CASE					:   Tuple=0.0							,   SCREAMING_SNAKE_CASE					:   Any=0.0							,   SCREAMING_SNAKE_CASE					:   int=0.0_2							,   SCREAMING_SNAKE_CASE					:   Dict=2							,   SCREAMING_SNAKE_CASE					:   List[str]=True							,   SCREAMING_SNAKE_CASE					:   Any=1							,   SCREAMING_SNAKE_CASE					:   List[Any]=0							,   SCREAMING_SNAKE_CASE					:   Any=2							,   SCREAMING_SNAKE_CASE					:   str=10_24							,   **SCREAMING_SNAKE_CASE					:   int							,   ):


      '''simple docstring'''






      UpperCamelCase__			:   int       				=  vocab_size
      UpperCamelCase__			:   Optional[Any]       				=  d_model
      UpperCamelCase__			:   Optional[Any]       				=  decoder_ffn_dim
      UpperCamelCase__			:   str       				=  decoder_layers
      UpperCamelCase__			:   Any       				=  decoder_attention_heads
      UpperCamelCase__			:   List[str]       				=  dropout
      UpperCamelCase__			:   int       				=  attention_dropout
      UpperCamelCase__			:   Optional[int]       				=  activation_dropout
      UpperCamelCase__			:   Union[str, Any]       				=  activation_function
      UpperCamelCase__			:   Tuple       				=  init_std
      UpperCamelCase__			:   Optional[int]       				=  decoder_layerdrop
      UpperCamelCase__			:   Dict       				=  use_cache
      UpperCamelCase__			:   str       				=  decoder_layers
      UpperCamelCase__			:   Union[str, Any]       				=  scale_embedding  # scale factor will be sqrt(d_model) if True
      UpperCamelCase__			:   Optional[Any]       				=  max_target_positions

      super().__init__(
          pad_token_id=SCREAMING_SNAKE_CASE							,   bos_token_id=SCREAMING_SNAKE_CASE							,   eos_token_id=SCREAMING_SNAKE_CASE							,   decoder_start_token_id=SCREAMING_SNAKE_CASE							,   **SCREAMING_SNAKE_CASE							,   )