





'''simple docstring'''






from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


__UpperCamelCase					    =	logging.get_logger(__name__)

__UpperCamelCase					    =	{
    "xlm-mlm-en-2048": "https://huggingface.co/xlm-mlm-en-2048/resolve/main/config.json",
    "xlm-mlm-ende-1024": "https://huggingface.co/xlm-mlm-ende-1024/resolve/main/config.json",
    "xlm-mlm-enfr-1024": "https://huggingface.co/xlm-mlm-enfr-1024/resolve/main/config.json",
    "xlm-mlm-enro-1024": "https://huggingface.co/xlm-mlm-enro-1024/resolve/main/config.json",
    "xlm-mlm-tlm-xnli15-1024": "https://huggingface.co/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json",
    "xlm-mlm-xnli15-1024": "https://huggingface.co/xlm-mlm-xnli15-1024/resolve/main/config.json",
    "xlm-clm-enfr-1024": "https://huggingface.co/xlm-clm-enfr-1024/resolve/main/config.json",
    "xlm-clm-ende-1024": "https://huggingface.co/xlm-clm-ende-1024/resolve/main/config.json",
    "xlm-mlm-17-1280": "https://huggingface.co/xlm-mlm-17-1280/resolve/main/config.json",
    "xlm-mlm-100-1280": "https://huggingface.co/xlm-mlm-100-1280/resolve/main/config.json",
}




class  _A (					__lowercase		):
		lowercase__:   int				     =   '''xlm'''
		lowercase__:   Dict				     =   {
		    '''hidden_size''': '''emb_dim''',
		    '''num_attention_heads''': '''n_heads''',
		    '''num_hidden_layers''': '''n_layers''',
		    '''n_words''': '''vocab_size''',  # For backward compatibility
		}

		def __init__(   self					:   str  ,      __magic_name__					:   str=3_01_45  ,      __magic_name__					:   str=20_48  ,      __magic_name__					:   Dict=12  ,      __magic_name__					:   List[Any]=16  ,      __magic_name__					:   Optional[int]=0.1  ,      __magic_name__					:   List[Any]=0.1  ,      __magic_name__					:   Optional[Any]=True  ,      __magic_name__					:   Tuple=False  ,      __magic_name__					:   List[Any]=False  ,      __magic_name__					:   List[str]=False  ,      __magic_name__					:   List[Any]=1  ,      __magic_name__					:   int=True  ,      __magic_name__					:   List[Any]=5_12  ,      __magic_name__					:   List[Any]=20_48**-0.5  ,      __magic_name__					:   Tuple=1E-12  ,      __magic_name__					:   List[str]=0.02  ,      __magic_name__					:   List[str]=0  ,      __magic_name__					:   str=1  ,      __magic_name__					:   Union[str, Any]=2  ,      __magic_name__					:   List[Any]=3  ,      __magic_name__					:   Union[str, Any]=5  ,      __magic_name__					:   List[str]=True  ,      __magic_name__					:   Dict="first"  ,      __magic_name__					:   str=True  ,      __magic_name__					:   Optional[Any]=None  ,      __magic_name__					:   Optional[Any]=True  ,      __magic_name__					:   List[str]=0.1  ,      __magic_name__					:   List[str]=5  ,      __magic_name__					:   List[Any]=5  ,      __magic_name__					:   int=0  ,      __magic_name__					:   int=0  ,      __magic_name__					:   List[str]=2  ,      __magic_name__					:   int=0  ,      **__magic_name__					:   Any  ,      )					->    List[Any]:


					"""simple docstring"""

					__snake_case					:      List[Any]							      =     vocab_size
					__snake_case					:      List[Any]							      =     emb_dim
					__snake_case					:      Tuple							      =     n_layers
					__snake_case					:      Union[str, Any]							      =     n_heads
					__snake_case					:      Optional[int]							      =     dropout
					__snake_case					:      Dict							      =     attention_dropout
					__snake_case					:      Tuple							      =     gelu_activation
					__snake_case					:      Any							      =     sinusoidal_embeddings
					__snake_case					:      List[Any]							      =     causal
					__snake_case					:      Dict							      =     asm
					__snake_case					:      Optional[Any]							      =     n_langs
					__snake_case					:      Any							      =     use_lang_emb
					__snake_case					:      int							      =     layer_norm_eps
					__snake_case					:      List[Any]							      =     bos_index
					__snake_case					:      Any							      =     eos_index
					__snake_case					:      Union[str, Any]							      =     pad_index
					__snake_case					:      Optional[Any]							      =     unk_index
					__snake_case					:      List[Any]							      =     mask_index
					__snake_case					:      Union[str, Any]							      =     is_encoder
					__snake_case					:      Optional[int]							      =     max_position_embeddings
					__snake_case					:      int							      =     embed_init_std
					__snake_case					:      Dict							      =     init_std
					__snake_case					:      Any							      =     summary_type
					__snake_case					:      int							      =     summary_use_proj
					__snake_case					:      Any							      =     summary_activation
					__snake_case					:      Any							      =     summary_proj_to_labels
					__snake_case					:      List[str]							      =     summary_first_dropout
					__snake_case					:      List[Any]							      =     start_n_top
					__snake_case					:      List[Any]							      =     end_n_top
					__snake_case					:      str							      =     mask_token_id
					__snake_case					:      List[Any]							      =     lang_id

					if "n_words" in kwargs:
								__snake_case					:      int							      =     kwargs["""n_words"""]

					super().__init__(pad_token_id=__magic_name__  ,      bos_token_id=__magic_name__  ,      **__magic_name__			)





class  _A (					__lowercase		):

		@property
		def 	lowercase__     (   self					:   Optional[int]			)					->    Mapping[str, Mapping[int, str]]:


					"""simple docstring"""

					if self.task == "multiple-choice":
								__snake_case					:      str							      =     {0: """batch""", 1: """choice""", 2: """sequence"""}
					else:
								__snake_case					:      Dict							      =     {0: """batch""", 1: """sequence"""}
					return OrderedDict(
					    [
					        ("""input_ids""", dynamic_axis),
					        ("""attention_mask""", dynamic_axis),
					        ("""token_type_ids""", dynamic_axis),
					    ]			)








'''simple docstring'''







from typing import List, Optional

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


lowercase      :   Optional[Any]      =       logging.get_logger(__name__)

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







class 					_a (a__	):





     '''simple docstring'''



     lowerCAmelCase_  :     List[str]          =					"""autoformer"""
     lowerCAmelCase_  :     int          =					{
         """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 = [1, 2, 3, 4, 5, 6, 7]							,__a = True							,__a = 0							,__a = 0							,__a = 0							,__a = 0							,__a = None							,__a = None							,__a = 64							,__a = 2							,__a = 2							,__a = 2							,__a = 2							,__a = 32							,__a = 32							,__a = "gelu"							,__a = 0.1							,__a = 0.1							,__a = 0.1							,__a = 0.1							,__a = 0.1							,__a = 100							,__a = 0.02							,__a = True							,__a=True							,__a = 10							,__a = 25							,__a = 3							,**__a							,)      ->				Union[str, Any]:
          # time series specific configuration
          snake_case			:      List[str]        =			prediction_length
          snake_case			:      str        =			context_length if context_length is not None else prediction_length
          snake_case			:      List[Any]        =			distribution_output
          snake_case			:      Any        =			loss
          snake_case			:      Union[str, Any]        =			input_size
          snake_case			:      Optional[int]        =			num_time_features
          snake_case			:      Union[str, Any]        =			lags_sequence
          snake_case			:      Any        =			scaling
          snake_case			:      str        =			num_dynamic_real_features
          snake_case			:      Union[str, Any]        =			num_static_real_features
          snake_case			:      Optional[int]        =			num_static_categorical_features
          if cardinality is not None and num_static_categorical_features > 0:
               if len(__a							) != num_static_categorical_features:
                    raise ValueError(
                        """The cardinality should be a list of the same length as `num_static_categorical_features`"""							)
               snake_case			:      int        =			cardinality
          else:
               snake_case			:      Optional[Any]        =			[0]
          if embedding_dimension is not None and num_static_categorical_features > 0:
               if len(__a							) != num_static_categorical_features:
                    raise ValueError(
                        """The embedding dimension should be a list of the same length as `num_static_categorical_features`"""							)
               snake_case			:      int        =			embedding_dimension
          else:
               snake_case			:      List[str]        =			[min(50							,(cat + 1) // 2							) for cat in self.cardinality]
          snake_case			:      Optional[int]        =			num_parallel_samples

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

          snake_case			:      str        =			dropout
          snake_case			:      Union[str, Any]        =			attention_dropout
          snake_case			:      Optional[Any]        =			activation_dropout
          snake_case			:      Tuple        =			encoder_layerdrop
          snake_case			:      Any        =			decoder_layerdrop

          snake_case			:      Any        =			activation_function
          snake_case			:      int        =			init_std

          snake_case			:      Optional[Any]        =			use_cache

          # Autoformer
          snake_case			:      int        =			label_length
          snake_case			:      str        =			moving_average
          snake_case			:      Tuple        =			autocorrelation_factor

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







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



