




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


lowerCAmelCase_						=			logging.get_logger(__name__)

lowerCAmelCase_						=			{
    'transfo-xl-wt103': 'https://huggingface.co/transfo-xl-wt103/resolve/main/config.json',
}
class 						_A (  _lowerCamelCase				):






  """simple docstring"""




  _UpperCamelCase       :      Optional[int]			=      '''transfo-xl'''
  _UpperCamelCase       :      List[str]			=      ['''mems''']
  _UpperCamelCase       :      str			=      {
      '''n_token''': '''vocab_size''',
      '''hidden_size''': '''d_model''',
      '''num_attention_heads''': '''n_head''',
      '''num_hidden_layers''': '''n_layer''',
  }






  def __init__(  self		:     Dict				,						_A		:     str=267_735				,						_A		:     Optional[Any]=[20_000, 40_000, 200_000]				,						_A		:     int=1_024				,						_A		:     Tuple=1_024				,						_A		:     Any=16				,						_A		:     Union[str, Any]=64				,						_A		:     Dict=4_096				,						_A		:     int=4				,						_A		:     Tuple=False				,						_A		:     int=18				,						_A		:     Optional[Any]=1_600				,						_A		:     str=1_000				,						_A		:     int=True				,						_A		:     int=True				,						_A		:     Any=0				,						_A		:     str=-1				,						_A		:     Any=True				,						_A		:     Optional[int]=0.1				,						_A		:     Union[str, Any]=0.0				,						_A		:     str=True				,						_A		:     str="normal"				,						_A		:     Tuple=0.01				,						_A		:     int=0.01				,						_A		:     int=0.02				,						_A		:     Dict=1E-5				,						_A		:     int=0				,						**_A		:     Any				,						)		->   int:






       """simple docstring"""







       lowercase :       Optional[Any]       =			vocab_size
       lowercase :       Any       =			[]
       self.cutoffs.extend(_A				)
       if proj_share_all_but_first:
            lowercase :       Union[str, Any]       =			[False] + [True] * len(self.cutoffs				)
       else:
            lowercase :       Tuple       =			[False] + [False] * len(self.cutoffs				)
       lowercase :       Optional[int]       =			d_model
       lowercase :       Optional[int]       =			d_embed
       lowercase :       Tuple       =			d_head
       lowercase :       List[Any]       =			d_inner
       lowercase :       Tuple       =			div_val
       lowercase :       Optional[Any]       =			pre_lnorm
       lowercase :       List[str]       =			n_layer
       lowercase :       Optional[int]       =			n_head
       lowercase :       Dict       =			mem_len
       lowercase :       int       =			same_length
       lowercase :       List[Any]       =			attn_type
       lowercase :       List[str]       =			clamp_len
       lowercase :       Any       =			sample_softmax
       lowercase :       Dict       =			adaptive
       lowercase :       Optional[Any]       =			dropout
       lowercase :       Any       =			dropatt
       lowercase :       Optional[int]       =			untie_r
       lowercase :       Union[str, Any]       =			init
       lowercase :       Any       =			init_range
       lowercase :       Any       =			proj_init_std
       lowercase :       List[str]       =			init_std
       lowercase :       Union[str, Any]       =			layer_norm_epsilon
       super().__init__(eos_token_id=_A				,						**_A				)






  @property
  def  __a      (  self		:     Any				)		->   List[str]:






       """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  __a      (  self		:     Dict				,						_A		:     int				)		->   Optional[Any]:






       """simple docstring"""







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





import os
from collections.abc import Iterator






def  snake_case(    __magic_name__ = "."   )			->							Iterator[str]:





     '''simple docstring'''


     for dir_path, dir_names, filenames in os.walk(__magic_name__   ):
          lowercase :       Tuple       =			[d for d in dir_names if d != '''scripts''' and d[0] not in '''._''']
          for filename in filenames:
               if filename == "__init__.py":
                    continue
               if os.path.splitext(__magic_name__   )[1] in (".py", ".ipynb"):
                    yield os.path.join(__magic_name__			,		__magic_name__   ).lstrip('''./'''   )






def  snake_case(    __magic_name__   )			->							Dict:





     '''simple docstring'''


     return F"""{i * '  '}*""" if i else "\n##"






def  snake_case(    __magic_name__			,		__magic_name__   )			->							str:





     '''simple docstring'''


     lowercase :       Dict       =			old_path.split(os.sep   )
     for i, new_part in enumerate(new_path.split(os.sep   )   ):
          if (i + 1 > len(__magic_name__   ) or old_parts[i] != new_part) and new_part:
               print(F"""{md_prefix(__magic_name__   )} {new_part.replace('_'			,		' '   ).title()}"""   )
     return new_path






def  snake_case(    __magic_name__ = "."   )			->							None:





     '''simple docstring'''


     lowercase :       str       =			''''''
     for filepath in sorted(good_file_paths(__magic_name__   )   ):
          lowercase      ,	lowercase :       Optional[int]       =			os.path.split(__magic_name__   )
          if filepath != old_path:
               lowercase :       str       =			print_path(__magic_name__			,		__magic_name__   )
          lowercase :       Optional[int]       =			(filepath.count(os.sep   ) + 1) if filepath else 0
          lowercase :       Optional[Any]       =			F"""{filepath}/{filename}""".replace(''' '''			,		'''%20'''   )
          lowercase :       List[str]       =			os.path.splitext(filename.replace('''_'''			,		''' '''   ).title()   )[0]
          print(F"""{md_prefix(__magic_name__   )} [{filename}]({url})"""   )


if __name__ == "__main__":
 print_directory_md('.')