

import warnings

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


lowerCAmelCase_       	=	logging.get_logger(__name__)

lowerCAmelCase_       	=	{
    '''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 	snake_case_   (		__A					):







			'''simple docstring'''

			SCREAMING_SNAKE_CASE     :   List[str]									=				"xlnet"
			SCREAMING_SNAKE_CASE     :   Union[str, Any]									=				["mems"]
			SCREAMING_SNAKE_CASE     :   Tuple									=				{
			    "n_token": "vocab_size",  # Backward compatibility
			    "hidden_size": "d_model",
			    "num_attention_heads": "n_head",
			    "num_hidden_layers": "n_layer",
			}







			def __init__(     self :				int							,   _UpperCamelCase :				Union[str, Any]=3_2_0_0_0							,   _UpperCamelCase :				int=1_0_2_4							,   _UpperCamelCase :				Any=2_4							,   _UpperCamelCase :				Union[str, Any]=1_6							,   _UpperCamelCase :				Optional[int]=4_0_9_6							,   _UpperCamelCase :				List[str]="gelu"							,   _UpperCamelCase :				str=True							,   _UpperCamelCase :				List[Any]="bi"							,   _UpperCamelCase :				Tuple=0.02							,   _UpperCamelCase :				Optional[int]=1e-12							,   _UpperCamelCase :				Any=0.1							,   _UpperCamelCase :				int=5_1_2							,   _UpperCamelCase :				Optional[int]=None							,   _UpperCamelCase :				Tuple=True							,   _UpperCamelCase :				List[str]=False							,   _UpperCamelCase :				Tuple=False							,   _UpperCamelCase :				int=-1							,   _UpperCamelCase :				int=False							,   _UpperCamelCase :				int="last"							,   _UpperCamelCase :				Tuple=True							,   _UpperCamelCase :				Optional[Any]="tanh"							,   _UpperCamelCase :				Dict=0.1							,   _UpperCamelCase :				Tuple=5							,   _UpperCamelCase :				List[Any]=5							,   _UpperCamelCase :				Any=5							,   _UpperCamelCase :				Optional[int]=1							,   _UpperCamelCase :				int=2							,   **_UpperCamelCase :				Dict							,   )      ->List[str]:
									snake_case_   =	vocab_size
									snake_case_   =	d_model
									snake_case_   =	n_layer
									snake_case_   =	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_   =	d_model // n_head
									snake_case_   =	ff_activation
									snake_case_   =	d_inner
									snake_case_   =	untie_r
									snake_case_   =	attn_type

									snake_case_   =	initializer_range
									snake_case_   =	layer_norm_eps

									snake_case_   =	dropout
									snake_case_   =	mem_len
									snake_case_   =	reuse_len
									snake_case_   =	bi_data
									snake_case_   =	clamp_len
									snake_case_   =	same_length

									snake_case_   =	summary_type
									snake_case_   =	summary_use_proj
									snake_case_   =	summary_activation
									snake_case_   =	summary_last_dropout
									snake_case_   =	start_n_top
									snake_case_   =	end_n_top

									snake_case_   =	bos_token_id
									snake_case_   =	pad_token_id
									snake_case_   =	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.'''							,   _UpperCamelCase							,   )
															snake_case_   =	kwargs['''use_cache''']

									snake_case_   =	use_mems_eval
									snake_case_   =	use_mems_train
									super().__init__(pad_token_id=_UpperCamelCase							,   bos_token_id=_UpperCamelCase							,   eos_token_id=_UpperCamelCase							,   **_UpperCamelCase							)







			@property
			def 				snake_case__(     self :				List[str]							)      ->Union[str, 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 				snake_case__(     self :				Dict							,   _UpperCamelCase :				List[Any]							)      ->int:
									# 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 ..utils import DummyObject, requires_backends





class 	snake_case_   (		metaclass=__A					):







			'''simple docstring'''

			SCREAMING_SNAKE_CASE     :   Union[str, Any]									=				["note_seq"]







			def __init__(     self :				Optional[int]							,   *_UpperCamelCase :				str							,   **_UpperCamelCase :				Optional[int]							)      ->Any:
									requires_backends(self							,   ['''note_seq''']							)







			@classmethod
			def 				snake_case__(     cls :				int							,   *_UpperCamelCase :				Any							,   **_UpperCamelCase :				List[Any]							)      ->int:
									requires_backends(cls							,   ['''note_seq''']							)







			@classmethod
			def 				snake_case__(     cls :				Dict							,   *_UpperCamelCase :				Optional[int]							,   **_UpperCamelCase :				Union[str, Any]							)      ->List[str]:
									requires_backends(cls							,   ['''note_seq''']							)