






import warnings

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


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

__lowerCamelCase :      int										=    {
    'xlnet-base-cased': 'https://huggingface.co/xlnet-base-cased/resolve/main/config.json',
    'xlnet-large-cased': 'https://huggingface.co/xlnet-large-cased/resolve/main/config.json',
}



class 							SCREAMING_SNAKE_CASE__						(    _A						):





					"""simple docstring"""






					a_     =		"xlnet"
					a_     =		["mems"]
					a_     =		{
					    "n_token": "vocab_size",  # Backward compatibility
					    "hidden_size": "d_model",
					    "num_attention_heads": "n_head",
					    "num_hidden_layers": "n_layer",
					}



					def __init__( self					:  Optional[Any]							,		__A					:  Optional[int]=3_2_0_0_0							,		__A					:  Dict=1_0_2_4							,		__A					:  str=2_4							,		__A					:  Union[str, Any]=1_6							,		__A					:  Dict=4_0_9_6							,		__A					:  Dict="gelu"							,		__A					:  Any=True							,		__A					:  Union[str, Any]="bi"							,		__A					:  List[Any]=0.0_2							,		__A					:  List[Any]=1e-1_2							,		__A					:  int=0.1							,		__A					:  Union[str, Any]=5_1_2							,		__A					:  List[str]=None							,		__A					:  Optional[Any]=True							,		__A					:  Any=False							,		__A					:  Dict=False							,		__A					:  Tuple=-1							,		__A					:  Dict=False							,		__A					:  Any="last"							,		__A					:  Dict=True							,		__A					:  Tuple="tanh"							,		__A					:  str=0.1							,		__A					:  Dict=5							,		__A					:  Optional[Any]=5							,		__A					:  str=5							,		__A					:  Dict=1							,		__A					:  str=2							,		**__A					:  Optional[Any]							,		):
						snake_case__			:				Union[str, Any]       =  vocab_size
						snake_case__			:				Optional[Any]       =  d_model
						snake_case__			:				Any       =  n_layer
						snake_case__			:				Optional[int]       =  n_head
						if d_model % n_head != 0:
							raise ValueError(f'''\'d_model % n_head\' ({d_model % n_head}) should be equal to 0'''	)
						if "d_head" in kwargs:
							if kwargs["d_head"] != d_model // n_head:
								raise ValueError(
								    f'''`d_head` ({kwargs['d_head']}) should be equal to `d_model // n_head` ({d_model // n_head})'''	)
						snake_case__			:				List[str]       =  d_model // n_head
						snake_case__			:				Any       =  ff_activation
						snake_case__			:				int       =  d_inner
						snake_case__			:				Dict       =  untie_r
						snake_case__			:				Union[str, Any]       =  attn_type

						snake_case__			:				int       =  initializer_range
						snake_case__			:				Optional[Any]       =  layer_norm_eps

						snake_case__			:				str       =  dropout
						snake_case__			:				Optional[Any]       =  mem_len
						snake_case__			:				Optional[Any]       =  reuse_len
						snake_case__			:				Any       =  bi_data
						snake_case__			:				List[str]       =  clamp_len
						snake_case__			:				List[Any]       =  same_length

						snake_case__			:				str       =  summary_type
						snake_case__			:				List[Any]       =  summary_use_proj
						snake_case__			:				Any       =  summary_activation
						snake_case__			:				List[Any]       =  summary_last_dropout
						snake_case__			:				Tuple       =  start_n_top
						snake_case__			:				Any       =  end_n_top

						snake_case__			:				str       =  bos_token_id
						snake_case__			:				Tuple       =  pad_token_id
						snake_case__			:				int       =  eos_token_id

						if "use_cache" in kwargs:
							warnings.warn(
							    "The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`"
							    " instead."							,		__SCREAMING_SNAKE_CASE							,		)
							snake_case__			:				Tuple       =  kwargs["use_cache"]

						snake_case__			:				Union[str, Any]       =  use_mems_eval
						snake_case__			:				Optional[int]       =  use_mems_train
						super().__init__(pad_token_id=__SCREAMING_SNAKE_CASE							,		bos_token_id=__SCREAMING_SNAKE_CASE							,		eos_token_id=__SCREAMING_SNAKE_CASE							,		**__SCREAMING_SNAKE_CASE	)



					@property
					def 	_lowercase					( self					:  Any	):
						logger.info(f'''The model {self.model_type} is one of the few models that has no sequence length limit.'''	)
						return -1






					@max_position_embeddings.setter
					def 	_lowercase					( self					:  Any							,		__A					:  List[Any]	):
						# Message copied from Transformer-XL documentation
						raise NotImplementedError(
						    f'''The model {self.model_type} is one of the few models that has no sequence length limit.'''	)











from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__lowerCamelCase :      Union[str, Any]										=				{
    """configuration_time_series_transformer""": [
        """TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """TimeSeriesTransformerConfig""",
    ],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowerCamelCase :      Tuple										=				[
	    """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

	__lowerCamelCase :      Tuple										=				_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



