



"""simple docstring"""







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


lowercase__		:				Tuple          =	logging.get_logger(__name__)

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







class       UpperCamelCase__   (	lowercase_  ):




      """simple docstring"""




      _SCREAMING_SNAKE_CASE  				=     """transfo-xl"""
      _SCREAMING_SNAKE_CASE  				=     ["""mems"""]
      _SCREAMING_SNAKE_CASE  				=     {
          """n_token""": """vocab_size""",
          """hidden_size""": """d_model""",
          """num_attention_heads""": """n_head""",
          """num_hidden_layers""": """n_layer""",
      }



      def __init__(      self				:      Union[str, Any]    ,			SCREAMING_SNAKE_CASE_				:      Tuple=2_6_7_7_3_5    ,			SCREAMING_SNAKE_CASE_				:      List[str]=[2_0_0_0_0, 4_0_0_0_0, 2_0_0_0_0_0]    ,			SCREAMING_SNAKE_CASE_				:      Optional[Any]=1_0_2_4    ,			SCREAMING_SNAKE_CASE_				:      Tuple=1_0_2_4    ,			SCREAMING_SNAKE_CASE_				:      str=1_6    ,			SCREAMING_SNAKE_CASE_				:      Tuple=6_4    ,			SCREAMING_SNAKE_CASE_				:      Tuple=4_0_9_6    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=4    ,			SCREAMING_SNAKE_CASE_				:      Optional[int]=False    ,			SCREAMING_SNAKE_CASE_				:      str=1_8    ,			SCREAMING_SNAKE_CASE_				:      Any=1_6_0_0    ,			SCREAMING_SNAKE_CASE_				:      List[str]=1_0_0_0    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=True    ,			SCREAMING_SNAKE_CASE_				:      str=True    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=0    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=-1    ,			SCREAMING_SNAKE_CASE_				:      Any=True    ,			SCREAMING_SNAKE_CASE_				:      List[str]=0.1    ,			SCREAMING_SNAKE_CASE_				:      Optional[int]=0.0    ,			SCREAMING_SNAKE_CASE_				:      Any=True    ,			SCREAMING_SNAKE_CASE_				:      Tuple="normal"    ,			SCREAMING_SNAKE_CASE_				:      Dict=0.01    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=0.01    ,			SCREAMING_SNAKE_CASE_				:      int=0.02    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=1E-5    ,			SCREAMING_SNAKE_CASE_				:      str=0    ,			**SCREAMING_SNAKE_CASE_				:      str    ,			):
        lowerCAmelCase_   :				Optional[Any]								= vocab_size
        lowerCAmelCase_   :				Union[str, Any]								= []
        self.cutoffs.extend(SCREAMING_SNAKE_CASE_       )
        if proj_share_all_but_first:
          lowerCAmelCase_   :				Optional[Any]								= [False] + [True] * len(self.cutoffs       )
        else:
          lowerCAmelCase_   :				List[Any]								= [False] + [False] * len(self.cutoffs       )
        lowerCAmelCase_   :				Tuple								= d_model
        lowerCAmelCase_   :				List[Any]								= d_embed
        lowerCAmelCase_   :				str								= d_head
        lowerCAmelCase_   :				str								= d_inner
        lowerCAmelCase_   :				int								= div_val
        lowerCAmelCase_   :				Optional[int]								= pre_lnorm
        lowerCAmelCase_   :				Optional[int]								= n_layer
        lowerCAmelCase_   :				Optional[int]								= n_head
        lowerCAmelCase_   :				int								= mem_len
        lowerCAmelCase_   :				Tuple								= same_length
        lowerCAmelCase_   :				Dict								= attn_type
        lowerCAmelCase_   :				List[Any]								= clamp_len
        lowerCAmelCase_   :				List[str]								= sample_softmax
        lowerCAmelCase_   :				str								= adaptive
        lowerCAmelCase_   :				Union[str, Any]								= dropout
        lowerCAmelCase_   :				Union[str, Any]								= dropatt
        lowerCAmelCase_   :				Tuple								= untie_r
        lowerCAmelCase_   :				Optional[Any]								= init
        lowerCAmelCase_   :				Tuple								= init_range
        lowerCAmelCase_   :				Union[str, Any]								= proj_init_std
        lowerCAmelCase_   :				Any								= init_std
        lowerCAmelCase_   :				Tuple								= layer_norm_epsilon
        super().__init__(eos_token_id=SCREAMING_SNAKE_CASE_    ,			**SCREAMING_SNAKE_CASE_       )



      @property
      def      SCREAMING_SNAKE_CASE__ (      self				:      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      SCREAMING_SNAKE_CASE__ (      self				:      Union[str, Any]    ,			SCREAMING_SNAKE_CASE_				:      List[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."       )










"""simple docstring"""







import re

def 				UpperCamelCase_    (    lowerCAmelCase__      :				str						)						->   list:

  """simple docstring"""




  return [char.split() for char in re.split(R'[^ a-z A-Z 0-9 \s]'    ,   str_						)]

def 				UpperCamelCase_    (    lowerCAmelCase__      :				str						)						->   str:

  """simple docstring"""




  lowerCAmelCase_   :				str								= split_input(str_						)
  return "".join(
      [''.join([char.capitalize() for char in sub_str]						) for sub_str in string_split]						)

def 				UpperCamelCase_    (    lowerCAmelCase__      :				str    ,   lowerCAmelCase__      :				bool    ,   lowerCAmelCase__      :				str						)						->   str:

  """simple docstring"""




  try:
    lowerCAmelCase_   :				int								= split_input(lowerCAmelCase__						)
    if upper:
      lowerCAmelCase_   :				Optional[int]								= ''.join(
          [
              separator.join([char.upper() for char in sub_str]						)
              for sub_str in string_split
          ]						)
    else:
      lowerCAmelCase_   :				Any								= ''.join(
          [
              separator.join([char.lower() for char in sub_str]						)
              for sub_str in string_split
          ]						)
    return res_str
  except IndexError:
    return "not valid string"

def 				UpperCamelCase_    (    lowerCAmelCase__      :				str						)						->   str:

  """simple docstring"""




  return to_simple_case(lowerCAmelCase__						)

def 				UpperCamelCase_    (    lowerCAmelCase__      :				str						)						->   str:

  """simple docstring"""




  try:
    lowerCAmelCase_   :				Dict								= to_simple_case(lowerCAmelCase__						)
    return res_str[0].lower() + res_str[1:]
  except IndexError:
    return "not valid string"

def 				UpperCamelCase_    (    lowerCAmelCase__      :				str    ,   lowerCAmelCase__      :				bool						)						->   str:

  """simple docstring"""




  return to_complex_case(lowerCAmelCase__    ,   lowerCAmelCase__    ,   '_'						)

def 				UpperCamelCase_    (    lowerCAmelCase__      :				str    ,   lowerCAmelCase__      :				bool						)						->   str:

  """simple docstring"""




  return to_complex_case(lowerCAmelCase__    ,   lowerCAmelCase__    ,   '-'						)


if __name__ == "__main__":
     __import__("""doctest""").testmod()





