






'''simple docstring'''




from typing import List, Optional, Union

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


__lowerCamelCase :       str 				=       logging.get_logger(__name__)

__lowerCamelCase :       Optional[Any] 				=       {
    '''huggingface/time-series-transformer-tourism-monthly''': (
        '''https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json'''
    ),
    # See all TimeSeriesTransformer models at https://huggingface.co/models?filter=time_series_transformer
}







class  A_						(A_				):
							"""simple docstring"""




							a__ 		=						"time_series_transformer"
							a__ 		=						{
							    "hidden_size": "d_model",
							    "num_attention_heads": "encoder_attention_heads",
							    "num_hidden_layers": "encoder_layers",
							}

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


										'''simple docstring'''




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

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

										snake_case_					:       str =							dropout
										snake_case_					:       Tuple =							attention_dropout
										snake_case_					:       Tuple =							activation_dropout
										snake_case_					:       int =							encoder_layerdrop
										snake_case_					:       Union[str, Any] =							decoder_layerdrop

										snake_case_					:       Optional[Any] =							activation_function
										snake_case_					:       Optional[Any] =							init_std

										snake_case_					:       Dict =							use_cache

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






							@property
							def 				_A						(		self      :List[str]					)					->	int:


										'''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 collections import OrderedDict
from typing import Mapping

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


__lowerCamelCase				=			logging.get_logger(__name__)

__lowerCamelCase				=			{
    """kssteven/ibert-roberta-base""": """https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json""",
    """kssteven/ibert-roberta-large""": """https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json""",
    """kssteven/ibert-roberta-large-mnli""": (
        """https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json"""
    ),
}






class     UpperCAmelCase						(		A_					):
   A__   :						Optional[int]			=	"ibert"



   def __init__(self						:   List[Any]       ,		snake_case__						:   int=3_05_22       ,		snake_case__						:   int=7_68       ,		snake_case__						:   Any=12       ,		snake_case__						:   str=12       ,		snake_case__						:   Optional[int]=30_72       ,		snake_case__						:   Union[str, Any]="gelu"       ,		snake_case__						:   Any=0.1       ,		snake_case__						:   List[Any]=0.1       ,		snake_case__						:   str=5_12       ,		snake_case__						:   Optional[int]=2       ,		snake_case__						:   Any=0.02       ,		snake_case__						:   List[Any]=1e-12       ,		snake_case__						:   Optional[Any]=1       ,		snake_case__						:   List[Any]=0       ,		snake_case__						:   str=2       ,		snake_case__						:   Tuple="absolute"       ,		snake_case__						:   List[str]=False       ,		snake_case__						:   Tuple="none"       ,		**snake_case__						:   Tuple       ,		)						->      Union[str, Any]:


          '''simple docstring'''


          super().__init__(pad_token_id=snake_case__       ,		bos_token_id=snake_case__       ,		eos_token_id=snake_case__       ,		**snake_case__					)

          snake_case			:  str     							= vocab_size
          snake_case			:  Tuple     							= hidden_size
          snake_case			:  Optional[Any]     							= num_hidden_layers
          snake_case			:  Optional[int]     							= num_attention_heads
          snake_case			:  List[Any]     							= hidden_act
          snake_case			:  Optional[Any]     							= intermediate_size
          snake_case			:  Dict     							= hidden_dropout_prob
          snake_case			:  List[str]     							= attention_probs_dropout_prob
          snake_case			:  List[str]     							= max_position_embeddings
          snake_case			:  Union[str, Any]     							= type_vocab_size
          snake_case			:  Optional[int]     							= initializer_range
          snake_case			:  Optional[int]     							= layer_norm_eps
          snake_case			:  int     							= position_embedding_type
          snake_case			:  Union[str, Any]     							= quant_mode
          snake_case			:  Dict     							= force_dequant






class     UpperCAmelCase						(		A_					):



   @property
   def 							_SCREAMING_SNAKE_CASE  (self						:   Tuple					)						->      Mapping[str, Mapping[int, str]]:


          '''simple docstring'''


          if self.task == "multiple-choice":
                 snake_case			:  Optional[Any]     							= {0: "batch", 1: "choice", 2: "sequence"}
          else:
                 snake_case			:  List[Any]     							= {0: "batch", 1: "sequence"}
          return OrderedDict(
              [
                  ("input_ids", dynamic_axis),
                  ("attention_mask", dynamic_axis),
              ]					)





