






from typing import Callable, Optional, Union

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


__UpperCAmelCase								=						logging.get_logger(__name__)

__UpperCAmelCase								=						{
    'microsoft/xprophetnet-large-wiki100-cased': (
        'https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json'
    ),
}



class   lowerCamelCase      (_snake_case			):







		'''simple docstring'''



		_snake_case    :    Tuple       						=  '''xlm-prophetnet'''
		_snake_case    :    Dict       						=  ['''past_key_values''']
		_snake_case    :    List[str]       						=  {
		    '''num_attention_heads''': '''num_encoder_attention_heads''',
		}



		def __init__(							self				,		_UpperCamelCase = 0.1				,		_UpperCamelCase = "gelu"				,		_UpperCamelCase = 3_0_5_2_2				,		_UpperCamelCase = 1_0_2_4				,		_UpperCamelCase = 4_0_9_6				,		_UpperCamelCase = 1_2				,		_UpperCamelCase = 1_6				,		_UpperCamelCase = 4_0_9_6				,		_UpperCamelCase = 1_2				,		_UpperCamelCase = 1_6				,		_UpperCamelCase = 0.1				,		_UpperCamelCase = 0.1				,		_UpperCamelCase = 5_1_2				,		_UpperCamelCase = 0.02				,		_UpperCamelCase = True				,		_UpperCamelCase = True				,		_UpperCamelCase = 0				,		_UpperCamelCase = 2				,		_UpperCamelCase = 3_2				,		_UpperCamelCase = 1_2_8				,		_UpperCamelCase = False				,		_UpperCamelCase = 0.0				,		_UpperCamelCase = True				,		_UpperCamelCase = 0				,		_UpperCamelCase = 1				,		_UpperCamelCase = 2				,		**_UpperCamelCase				,		)	->							Tuple:
							UpperCAmelCase_    :      Tuple            =						vocab_size
							UpperCAmelCase_    :      Any            =						hidden_size
							UpperCAmelCase_    :      Union[str, Any]            =						encoder_ffn_dim
							UpperCAmelCase_    :      Optional[Any]            =						num_encoder_layers
							UpperCAmelCase_    :      Optional[int]            =						num_encoder_attention_heads
							UpperCAmelCase_    :      Union[str, Any]            =						decoder_ffn_dim
							UpperCAmelCase_    :      List[Any]            =						num_decoder_layers
							UpperCAmelCase_    :      Optional[int]            =						num_decoder_attention_heads
							UpperCAmelCase_    :      Tuple            =						max_position_embeddings
							UpperCAmelCase_    :      int            =						init_std  # Normal(0, this parameter)
							UpperCAmelCase_    :      Optional[int]            =						activation_function

							# parameters for xlmprophetnet
							UpperCAmelCase_    :      List[Any]            =						ngram
							UpperCAmelCase_    :      Tuple            =						num_buckets
							UpperCAmelCase_    :      Optional[Any]            =						relative_max_distance
							UpperCAmelCase_    :      Any            =						disable_ngram_loss
							UpperCAmelCase_    :      Optional[Any]            =						eps

							# 3 Types of Dropout
							UpperCAmelCase_    :      Any            =						attention_dropout
							UpperCAmelCase_    :      Tuple            =						activation_dropout
							UpperCAmelCase_    :      Dict            =						dropout

							UpperCAmelCase_    :      Dict            =						use_cache

							super().__init__(
							    pad_token_id=_UpperCamelCase				,		bos_token_id=_UpperCamelCase				,		eos_token_id=_UpperCamelCase				,		is_encoder_decoder=_UpperCamelCase				,		add_cross_attention=_UpperCamelCase				,		decoder_start_token_id=_UpperCamelCase				,		**_UpperCamelCase				,		)



		@property
		def 					__UpperCAmelCase			(							self   )	->							int:
							return self.num_encoder_layers + self.num_decoder_layers



		@num_hidden_layers.setter
		def 					__UpperCAmelCase			(							self				,		_UpperCamelCase   )	->							int:
							raise NotImplementedError(
							    'This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and'
							    ' `num_decoder_layers`.'   )














from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCAmelCase								=						{
    'configuration_time_series_transformer': [
        'TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'TimeSeriesTransformerConfig',
    ],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCAmelCase								=						[
		    'TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TimeSeriesTransformerForPrediction',
		    'TimeSeriesTransformerModel',
		    'TimeSeriesTransformerPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_time_series_transformer import (
		    TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    TimeSeriesTransformerConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_time_series_transformer import (
				    TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TimeSeriesTransformerForPrediction,
				    TimeSeriesTransformerModel,
				    TimeSeriesTransformerPreTrainedModel,
				)

else:
		import sys

		__UpperCAmelCase								=						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






