






import warnings

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


a_		:						Tuple             =    logging.get_logger(__name__)

a_		:						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 		_snake_case  (  A__					):
			_lowercase		:    Any			     =							'''xlnet'''
			_lowercase		:    Optional[int]			     =							['''mems''']
			_lowercase		:    List[Any]			     =							{
			    '''n_token''': '''vocab_size''',  # Backward compatibility
			    '''hidden_size''': '''d_model''',
			    '''num_attention_heads''': '''n_head''',
			    '''num_hidden_layers''': '''n_layer''',
			}






			def __init__(       self		,					a=3_2000		,					a=1024		,					a=24		,					a=16		,					a=4096		,					a="gelu"		,					a=True		,					a="bi"		,					a=0.02		,					a=1E-12		,					a=0.1		,					a=512		,					a=None		,					a=True		,					a=False		,					a=False		,					a=-1		,					a=False		,					a="last"		,					a=True		,					a="tanh"		,					a=0.1		,					a=5		,					a=5		,					a=5		,					a=1		,					a=2		,					**a		,					)      ->       Optional[int]:
						SCREAMING_SNAKE_CASE						= vocab_size
						SCREAMING_SNAKE_CASE						= d_model
						SCREAMING_SNAKE_CASE						= n_layer
						SCREAMING_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})''')
						SCREAMING_SNAKE_CASE						= d_model // n_head
						SCREAMING_SNAKE_CASE						= ff_activation
						SCREAMING_SNAKE_CASE						= d_inner
						SCREAMING_SNAKE_CASE						= untie_r
						SCREAMING_SNAKE_CASE						= attn_type

						SCREAMING_SNAKE_CASE						= initializer_range
						SCREAMING_SNAKE_CASE						= layer_norm_eps

						SCREAMING_SNAKE_CASE						= dropout
						SCREAMING_SNAKE_CASE						= mem_len
						SCREAMING_SNAKE_CASE						= reuse_len
						SCREAMING_SNAKE_CASE						= bi_data
						SCREAMING_SNAKE_CASE						= clamp_len
						SCREAMING_SNAKE_CASE						= same_length

						SCREAMING_SNAKE_CASE						= summary_type
						SCREAMING_SNAKE_CASE						= summary_use_proj
						SCREAMING_SNAKE_CASE						= summary_activation
						SCREAMING_SNAKE_CASE						= summary_last_dropout
						SCREAMING_SNAKE_CASE						= start_n_top
						SCREAMING_SNAKE_CASE						= end_n_top

						SCREAMING_SNAKE_CASE						= bos_token_id
						SCREAMING_SNAKE_CASE						= pad_token_id
						SCREAMING_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.'		,					a		,					)
									SCREAMING_SNAKE_CASE						= kwargs['use_cache']

						SCREAMING_SNAKE_CASE						= use_mems_eval
						SCREAMING_SNAKE_CASE						= use_mems_train
						super().__init__(pad_token_id=a		,					bos_token_id=a		,					eos_token_id=a		,					**a)






			@property
			def    SCREAMING_SNAKE_CASE__    (       self)      ->       Dict:
						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    SCREAMING_SNAKE_CASE__    (       self		,					a)      ->       str:
						# 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


a_		:						List[Any]             =    {
    'configuration_bigbird_pegasus': [
        'BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'BigBirdPegasusConfig',
        'BigBirdPegasusOnnxConfig',
    ],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				a_		:						Dict             =    [
				    'BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'BigBirdPegasusForCausalLM',
				    'BigBirdPegasusForConditionalGeneration',
				    'BigBirdPegasusForQuestionAnswering',
				    'BigBirdPegasusForSequenceClassification',
				    'BigBirdPegasusModel',
				    'BigBirdPegasusPreTrainedModel',
				]


if TYPE_CHECKING:
				from .configuration_bigbird_pegasus import (
				    BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP,
				    BigBirdPegasusConfig,
				    BigBirdPegasusOnnxConfig,
				)

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_bigbird_pegasus import (
								    BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST,
								    BigBirdPegasusForCausalLM,
								    BigBirdPegasusForConditionalGeneration,
								    BigBirdPegasusForQuestionAnswering,
								    BigBirdPegasusForSequenceClassification,
								    BigBirdPegasusModel,
								    BigBirdPegasusPreTrainedModel,
								)


else:
				import sys

				a_		:						Tuple             =    _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




