
"""simple docstring"""



import warnings

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


a					:	List[str]							=		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 		a_						( a__	):

    '''simple docstring'''





    a      :				Union[str, Any]     =				'xlnet'
    a      :				Optional[int]     =				['mems']
    a      :				Any     =				{
        'n_token': 'vocab_size',  # Backward compatibility
        'hidden_size': 'd_model',
        'num_attention_heads': 'n_head',
        'num_hidden_layers': 'n_layer',
    }







    def __init__(			self			:       Tuple     ,					__UpperCamelCase			:       int=3_20_00     ,					__UpperCamelCase			:       Tuple=10_24     ,					__UpperCamelCase			:       Union[str, Any]=24     ,					__UpperCamelCase			:       Any=16     ,					__UpperCamelCase			:       Dict=40_96     ,					__UpperCamelCase			:       List[str]="gelu"     ,					__UpperCamelCase			:       Tuple=True     ,					__UpperCamelCase			:       List[Any]="bi"     ,					__UpperCamelCase			:       str=0.0_2     ,					__UpperCamelCase			:       int=1e-12     ,					__UpperCamelCase			:       str=0.1     ,					__UpperCamelCase			:       str=5_12     ,					__UpperCamelCase			:       Dict=None     ,					__UpperCamelCase			:       Optional[int]=True     ,					__UpperCamelCase			:       Dict=False     ,					__UpperCamelCase			:       List[Any]=False     ,					__UpperCamelCase			:       List[Any]=-1     ,					__UpperCamelCase			:       Optional[Any]=False     ,					__UpperCamelCase			:       List[Any]="last"     ,					__UpperCamelCase			:       Any=True     ,					__UpperCamelCase			:       List[str]="tanh"     ,					__UpperCamelCase			:       List[str]=0.1     ,					__UpperCamelCase			:       str=5     ,					__UpperCamelCase			:       Optional[Any]=5     ,					__UpperCamelCase			:       Any=5     ,					__UpperCamelCase			:       str=1     ,					__UpperCamelCase			:       List[str]=2     ,					**__UpperCamelCase			:       Union[str, Any]     ,					)		->List[str]:






        '''simple docstring'''






        _UpperCAmelCase          =   vocab_size
        _UpperCAmelCase          =   d_model
        _UpperCAmelCase          =   n_layer
        _UpperCAmelCase          =   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})"""     )
        _UpperCAmelCase          =   d_model // n_head
        _UpperCAmelCase          =   ff_activation
        _UpperCAmelCase          =   d_inner
        _UpperCAmelCase          =   untie_r
        _UpperCAmelCase          =   attn_type

        _UpperCAmelCase          =   initializer_range
        _UpperCAmelCase          =   layer_norm_eps

        _UpperCAmelCase          =   dropout
        _UpperCAmelCase          =   mem_len
        _UpperCAmelCase          =   reuse_len
        _UpperCAmelCase          =   bi_data
        _UpperCAmelCase          =   clamp_len
        _UpperCAmelCase          =   same_length

        _UpperCAmelCase          =   summary_type
        _UpperCAmelCase          =   summary_use_proj
        _UpperCAmelCase          =   summary_activation
        _UpperCAmelCase          =   summary_last_dropout
        _UpperCAmelCase          =   start_n_top
        _UpperCAmelCase          =   end_n_top

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

        _UpperCAmelCase          =   use_mems_eval
        _UpperCAmelCase          =   use_mems_train
        super().__init__(pad_token_id=_A     ,					bos_token_id=_A     ,					eos_token_id=_A     ,					**_A     )







    @property
    def      _snake_case					(			self			:       Optional[Any]     )		->Dict:






        '''simple docstring'''






        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			:       List[str]     ,					__UpperCamelCase			:       Optional[int]     )		->List[Any]:






        '''simple docstring'''






        raise NotImplementedError(
            f"""The model {self.model_type} is one of the few models that has no sequence length limit."""     )

"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a					:	Tuple							=		{
    '''configuration_pegasus_x''': ['''PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''PegasusXConfig'''],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a					:	List[str]							=		[
     '''PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''PegasusXForConditionalGeneration''',
     '''PegasusXModel''',
     '''PegasusXPreTrainedModel''',
 ]


if TYPE_CHECKING:
 from .configuration_pegasus_x import PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusXConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_pegasus_x import (
      PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST,
      PegasusXForConditionalGeneration,
      PegasusXModel,
      PegasusXPreTrainedModel,
  )


else:
 import sys

 a					:	Dict							=		_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)