





"""simple docstring"""






from typing import List, Optional, Union

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


lowerCAmelCase_			=							logging.get_logger(__name__)

lowerCAmelCase_			=							{
    '''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 	lowerCAmelCase					(      lowercase_							):
    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__ = 1_00    ,  a__ = 0.02    ,  a__=True    ,  a__ = "prob"    ,  a__ = 5    ,  a__ = True    ,  **a__    ,  ):
           _UpperCAmelCase     =     prediction_length
           _UpperCAmelCase     =     context_length or prediction_length
           _UpperCAmelCase     =     distribution_output
           _UpperCAmelCase     =     loss
           _UpperCAmelCase     =     input_size
           _UpperCAmelCase     =     num_time_features
           _UpperCAmelCase     =     lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
           _UpperCAmelCase     =     scaling
           _UpperCAmelCase     =     num_dynamic_real_features
           _UpperCAmelCase     =     num_static_real_features
           _UpperCAmelCase     =     num_static_categorical_features

           # set cardinality
           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`'     )
                  _UpperCAmelCase     =     cardinality
           else:
                  _UpperCAmelCase     =     [0]

           # set embedding_dimension
           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`'     )
                  _UpperCAmelCase     =     embedding_dimension
           else:
                  _UpperCAmelCase     =     [min(50    ,  (cat + 1) // 2     ) for cat in self.cardinality]

           _UpperCAmelCase     =     num_parallel_samples

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

           _UpperCAmelCase     =     dropout
           _UpperCAmelCase     =     attention_dropout
           _UpperCAmelCase     =     activation_dropout
           _UpperCAmelCase     =     encoder_layerdrop
           _UpperCAmelCase     =     decoder_layerdrop

           _UpperCAmelCase     =     activation_function
           _UpperCAmelCase     =     init_std

           _UpperCAmelCase     =     use_cache

           # Informer
           _UpperCAmelCase     =     attention_type
           _UpperCAmelCase     =     sampling_factor
           _UpperCAmelCase     =     distil

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






    @property
    def 							__A (   self     ):
           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


lowerCAmelCase_			=							logging.get_logger(__name__)

lowerCAmelCase_			=							{
    '''microsoft/trocr-base-handwritten''': (
        '''https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json'''
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}



class 	lowerCAmelCase					(      snake_case							):
       lowerCAmelCase__						 =  """trocr"""
       lowerCAmelCase__						 =  ["""past_key_values"""]
       lowerCAmelCase__						 =  {
           """num_attention_heads""": """decoder_attention_heads""",
           """hidden_size""": """d_model""",
           """num_hidden_layers""": """decoder_layers""",
       }






       def __init__(   self    ,  a__=5_02_65    ,  a__=10_24    ,  a__=12    ,  a__=16    ,  a__=40_96    ,  a__="gelu"    ,  a__=5_12    ,  a__=0.1    ,  a__=0.0    ,  a__=0.0    ,  a__=2    ,  a__=0.02    ,  a__=0.0    ,  a__=True    ,  a__=False    ,  a__=True    ,  a__=True    ,  a__=1    ,  a__=0    ,  a__=2    ,  **a__    ,  ):
              _UpperCAmelCase     =     vocab_size
              _UpperCAmelCase     =     d_model
              _UpperCAmelCase     =     decoder_layers
              _UpperCAmelCase     =     decoder_attention_heads
              _UpperCAmelCase     =     decoder_ffn_dim
              _UpperCAmelCase     =     activation_function
              _UpperCAmelCase     =     max_position_embeddings
              _UpperCAmelCase     =     dropout
              _UpperCAmelCase     =     attention_dropout
              _UpperCAmelCase     =     activation_dropout
              _UpperCAmelCase     =     init_std
              _UpperCAmelCase     =     decoder_layerdrop
              _UpperCAmelCase     =     use_cache
              _UpperCAmelCase     =     scale_embedding
              _UpperCAmelCase     =     use_learned_position_embeddings
              _UpperCAmelCase     =     layernorm_embedding

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






