

'''simple docstring'''

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


A_       						=							logging.get_logger(__name__)

A_       						=							{
    "transfo-xl-wt103": "https://huggingface.co/transfo-xl-wt103/resolve/main/config.json",
}





class 							_snake_case (       _a						):
   _A       :     int       =					'''transfo-xl'''
   _A       :     Optional[int]       =					['''mems''']
   _A       :     Optional[Any]       =					{
       '''n_token''': '''vocab_size''',
       '''hidden_size''': '''d_model''',
       '''num_attention_heads''': '''n_head''',
       '''num_hidden_layers''': '''n_layer''',
   }
   def __init__( self			:      Optional[Any]     ,SCREAMING_SNAKE_CASE__			:      Optional[int]=267_735     ,SCREAMING_SNAKE_CASE__			:      str=[20_000, 40_000, 200_000]     ,SCREAMING_SNAKE_CASE__			:      int=1_024     ,SCREAMING_SNAKE_CASE__			:      int=1_024     ,SCREAMING_SNAKE_CASE__			:      Dict=16     ,SCREAMING_SNAKE_CASE__			:      List[Any]=64     ,SCREAMING_SNAKE_CASE__			:      str=4_096     ,SCREAMING_SNAKE_CASE__			:      Optional[Any]=4     ,SCREAMING_SNAKE_CASE__			:      Dict=False     ,SCREAMING_SNAKE_CASE__			:      str=18     ,SCREAMING_SNAKE_CASE__			:      List[Any]=1_600     ,SCREAMING_SNAKE_CASE__			:      Dict=1_000     ,SCREAMING_SNAKE_CASE__			:      Optional[int]=True     ,SCREAMING_SNAKE_CASE__			:      Optional[Any]=True     ,SCREAMING_SNAKE_CASE__			:      Union[str, Any]=0     ,SCREAMING_SNAKE_CASE__			:      List[Any]=-1     ,SCREAMING_SNAKE_CASE__			:      List[Any]=True     ,SCREAMING_SNAKE_CASE__			:      Optional[Any]=0.1     ,SCREAMING_SNAKE_CASE__			:      Any=0.0     ,SCREAMING_SNAKE_CASE__			:      List[str]=True     ,SCREAMING_SNAKE_CASE__			:      List[str]="normal"     ,SCREAMING_SNAKE_CASE__			:      Tuple=0.01     ,SCREAMING_SNAKE_CASE__			:      List[str]=0.01     ,SCREAMING_SNAKE_CASE__			:      Any=0.02     ,SCREAMING_SNAKE_CASE__			:      str=1e-5     ,SCREAMING_SNAKE_CASE__			:      Optional[int]=0     ,**SCREAMING_SNAKE_CASE__			:      Any     ,):
     SCREAMING_SNAKE_CASE:Tuple						      =					vocab_size
     SCREAMING_SNAKE_CASE:Tuple						      =					[]
     self.cutoffs.extend(SCREAMING_SNAKE_CASE__							)
     if proj_share_all_but_first:
       SCREAMING_SNAKE_CASE:int						      =					[False] + [True] * len(self.cutoffs							)
     else:
       SCREAMING_SNAKE_CASE:Optional[Any]						      =					[False] + [False] * len(self.cutoffs							)
     SCREAMING_SNAKE_CASE:Any						      =					d_model
     SCREAMING_SNAKE_CASE:Optional[Any]						      =					d_embed
     SCREAMING_SNAKE_CASE:Optional[Any]						      =					d_head
     SCREAMING_SNAKE_CASE:str						      =					d_inner
     SCREAMING_SNAKE_CASE:Tuple						      =					div_val
     SCREAMING_SNAKE_CASE:Tuple						      =					pre_lnorm
     SCREAMING_SNAKE_CASE:str						      =					n_layer
     SCREAMING_SNAKE_CASE:Any						      =					n_head
     SCREAMING_SNAKE_CASE:Dict						      =					mem_len
     SCREAMING_SNAKE_CASE:Tuple						      =					same_length
     SCREAMING_SNAKE_CASE:int						      =					attn_type
     SCREAMING_SNAKE_CASE:str						      =					clamp_len
     SCREAMING_SNAKE_CASE:Any						      =					sample_softmax
     SCREAMING_SNAKE_CASE:Union[str, Any]						      =					adaptive
     SCREAMING_SNAKE_CASE:str						      =					dropout
     SCREAMING_SNAKE_CASE:List[str]						      =					dropatt
     SCREAMING_SNAKE_CASE:str						      =					untie_r
     SCREAMING_SNAKE_CASE:str						      =					init
     SCREAMING_SNAKE_CASE:Union[str, Any]						      =					init_range
     SCREAMING_SNAKE_CASE:Dict						      =					proj_init_std
     SCREAMING_SNAKE_CASE:Tuple						      =					init_std
     SCREAMING_SNAKE_CASE:str						      =					layer_norm_epsilon
     super().__init__(eos_token_id=SCREAMING_SNAKE_CASE__     ,**SCREAMING_SNAKE_CASE__							)
   @property
   def     __UpperCamelCase						( self			:      List[str]							):
     # Message copied from Transformer-XL documentation
     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     __UpperCamelCase						( self			:      Any     ,SCREAMING_SNAKE_CASE__			:      Dict							):
     # 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.'''							)









'''simple docstring'''

import warnings
from functools import wraps
from typing import Callable





def    A_  ( snake_case ):

  @wraps(snake_case )
  def _inner_fn(*snake_case      ,       **snake_case ):
    warnings.warn(
        (F'''\'{fn.__name__}\' is experimental and might be subject to breaking changes in the future.''')      ,       snake_case      ,       )
    return fn(*snake_case      ,       **snake_case )

  return _inner_fn






