


import warnings

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


__snake_case   							=						logging.get_logger(__name__)

__snake_case   							=						{
    '''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 	__lowerCamelCase			(_a						):
       _lowercase											=     """xlnet"""
       _lowercase											=     ["""mems"""]
       _lowercase											=     {
           """n_token""": """vocab_size""",  # Backward compatibility
           """hidden_size""": """d_model""",
           """num_attention_heads""": """n_head""",
           """num_hidden_layers""": """n_layer""",
       }







       def __init__(			self: Tuple,A_: Optional[int]=3_2000,A_: Tuple=1024,A_: List[Any]=24,A_: Union[str, Any]=16,A_: Union[str, Any]=4096,A_: Dict="gelu",A_: Dict=True,A_: str="bi",A_: Dict=0.0_2,A_: Optional[int]=1E-12,A_: Optional[Any]=0.1,A_: Union[str, Any]=512,A_: str=None,A_: Optional[Any]=True,A_: Union[str, Any]=False,A_: int=False,A_: List[str]=-1,A_: Any=False,A_: Dict="last",A_: int=True,A_: List[str]="tanh",A_: Optional[int]=0.1,A_: int=5,A_: Any=5,A_: Optional[int]=5,A_: Tuple=1,A_: List[str]=2,**A_: List[Any],):






            '''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: Tuple					):






            '''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: int,A_: List[Any]					):






            '''simple docstring'''




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






import pytest

import datasets


# Import fixture modules as plugins
__snake_case   							=						['''tests.fixtures.files''', '''tests.fixtures.hub''', '''tests.fixtures.fsspec''']






def 		_A		(		_lowercase					,  _lowercase )					-> Tuple:


     """simple docstring"""


     for item in items:
          if any(marker in item.keywords for marker in ['integration', 'unit'] ):
               continue
          item.add_marker(pytest.mark.unit )






def 		_A		(		_lowercase )					-> str:


     """simple docstring"""


     config.addinivalue_line('markers'					,  'torchaudio_latest: mark test to run with torchaudio>=0.12' )






@pytest.fixture(autouse=_lowercase )
def 		_A		(		_lowercase					,  _lowercase )					-> Any:


     """simple docstring"""


     __UpperCamelCase =			tmp_path_factory.getbasetemp() / 'cache'
     __UpperCamelCase =			test_hf_cache_home / 'datasets'
     __UpperCamelCase =			test_hf_cache_home / 'metrics'
     __UpperCamelCase =			test_hf_cache_home / 'modules'
     monkeypatch.setattr('datasets.config.HF_DATASETS_CACHE'					,  str(_lowercase ) )
     monkeypatch.setattr('datasets.config.HF_METRICS_CACHE'					,  str(_lowercase ) )
     monkeypatch.setattr('datasets.config.HF_MODULES_CACHE'					,  str(_lowercase ) )
     __UpperCamelCase =			test_hf_datasets_cache / 'downloads'
     monkeypatch.setattr('datasets.config.DOWNLOADED_DATASETS_PATH'					,  str(_lowercase ) )
     __UpperCamelCase =			test_hf_datasets_cache / 'downloads' / 'extracted'
     monkeypatch.setattr('datasets.config.EXTRACTED_DATASETS_PATH'					,  str(_lowercase ) )






@pytest.fixture(autouse=_lowercase					,  scope='session' )
def 		_A		(		)					-> Dict:


     """simple docstring"""


     datasets.disable_progress_bar()






@pytest.fixture(autouse=_lowercase )
def 		_A		(		_lowercase )					-> Tuple:


     """simple docstring"""


     monkeypatch.setattr('datasets.config.HF_UPDATE_DOWNLOAD_COUNTS'					,  _lowercase )






@pytest.fixture
def 		_A		(		_lowercase )					-> Any:


     """simple docstring"""


     monkeypatch.setattr('sqlalchemy.util.deprecations.SILENCE_UBER_WARNING'					,  _lowercase )


