

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


_SCREAMING_SNAKE_CASE					:  int             =      logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE					:  str             =      {'''ctrl''': '''https://huggingface.co/ctrl/resolve/main/config.json'''}






class 	UpperCAmelCase__		(	A__	):






  """simple docstring"""


  a									= "ctrl"
  a									= ["past_key_values"]
  a									= {
      "max_position_embeddings": "n_positions",
      "hidden_size": "n_embd",
      "num_attention_heads": "n_head",
      "num_hidden_layers": "n_layer",
  }






  def __init__(							self						:		Union[str, Any]     ,       __lowerCamelCase						:		Union[str, Any]=24_6534     ,       __lowerCamelCase						:		str=256     ,       __lowerCamelCase						:		str=1280     ,       __lowerCamelCase						:		Tuple=8192     ,       __lowerCamelCase						:		Optional[Any]=48     ,       __lowerCamelCase						:		Any=16     ,       __lowerCamelCase						:		List[str]=0.1     ,       __lowerCamelCase						:		List[Any]=0.1     ,       __lowerCamelCase						:		Optional[Any]=1e-6     ,       __lowerCamelCase						:		Union[str, Any]=0.02     ,       __lowerCamelCase						:		Union[str, Any]=True     ,       **__lowerCamelCase						:		Tuple     ,       )		->							Optional[Any]:
       SCREAMING_SNAKE_CASE__   =   vocab_size
       SCREAMING_SNAKE_CASE__   =   n_positions
       SCREAMING_SNAKE_CASE__   =   n_embd
       SCREAMING_SNAKE_CASE__   =   n_layer
       SCREAMING_SNAKE_CASE__   =   n_head
       SCREAMING_SNAKE_CASE__   =   dff
       SCREAMING_SNAKE_CASE__   =   resid_pdrop
       SCREAMING_SNAKE_CASE__   =   embd_pdrop
       SCREAMING_SNAKE_CASE__   =   layer_norm_epsilon
       SCREAMING_SNAKE_CASE__   =   initializer_range

       SCREAMING_SNAKE_CASE__   =   use_cache

       super().__init__(**__lowerCamelCase )





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


_SCREAMING_SNAKE_CASE					:  List[str]             =      logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE					:  Tuple             =      {
    '''transfo-xl-wt103''': '''https://huggingface.co/transfo-xl-wt103/resolve/main/config.json''',
}






class 	UpperCAmelCase__		(	A__	):






  """simple docstring"""


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






  def __init__(							self						:		Any     ,       __lowerCamelCase						:		int=26_7735     ,       __lowerCamelCase						:		Any=[2_0000, 4_0000, 20_0000]     ,       __lowerCamelCase						:		Dict=1024     ,       __lowerCamelCase						:		Optional[int]=1024     ,       __lowerCamelCase						:		List[Any]=16     ,       __lowerCamelCase						:		Union[str, Any]=64     ,       __lowerCamelCase						:		Dict=4096     ,       __lowerCamelCase						:		int=4     ,       __lowerCamelCase						:		Dict=False     ,       __lowerCamelCase						:		Tuple=18     ,       __lowerCamelCase						:		Optional[int]=1600     ,       __lowerCamelCase						:		str=1000     ,       __lowerCamelCase						:		Any=True     ,       __lowerCamelCase						:		Dict=True     ,       __lowerCamelCase						:		List[Any]=0     ,       __lowerCamelCase						:		int=-1     ,       __lowerCamelCase						:		Tuple=True     ,       __lowerCamelCase						:		List[Any]=0.1     ,       __lowerCamelCase						:		int=0.0     ,       __lowerCamelCase						:		int=True     ,       __lowerCamelCase						:		str="normal"     ,       __lowerCamelCase						:		List[str]=0.01     ,       __lowerCamelCase						:		Any=0.01     ,       __lowerCamelCase						:		List[str]=0.02     ,       __lowerCamelCase						:		List[str]=1e-5     ,       __lowerCamelCase						:		Union[str, Any]=0     ,       **__lowerCamelCase						:		int     ,       )		->							Optional[Any]:
       SCREAMING_SNAKE_CASE__   =   vocab_size
       SCREAMING_SNAKE_CASE__   =   []
       self.cutoffs.extend(__lowerCamelCase )
       if proj_share_all_but_first:
            SCREAMING_SNAKE_CASE__   =   [False] + [True] * len(self.cutoffs )
       else:
            SCREAMING_SNAKE_CASE__   =   [False] + [False] * len(self.cutoffs )
       SCREAMING_SNAKE_CASE__   =   d_model
       SCREAMING_SNAKE_CASE__   =   d_embed
       SCREAMING_SNAKE_CASE__   =   d_head
       SCREAMING_SNAKE_CASE__   =   d_inner
       SCREAMING_SNAKE_CASE__   =   div_val
       SCREAMING_SNAKE_CASE__   =   pre_lnorm
       SCREAMING_SNAKE_CASE__   =   n_layer
       SCREAMING_SNAKE_CASE__   =   n_head
       SCREAMING_SNAKE_CASE__   =   mem_len
       SCREAMING_SNAKE_CASE__   =   same_length
       SCREAMING_SNAKE_CASE__   =   attn_type
       SCREAMING_SNAKE_CASE__   =   clamp_len
       SCREAMING_SNAKE_CASE__   =   sample_softmax
       SCREAMING_SNAKE_CASE__   =   adaptive
       SCREAMING_SNAKE_CASE__   =   dropout
       SCREAMING_SNAKE_CASE__   =   dropatt
       SCREAMING_SNAKE_CASE__   =   untie_r
       SCREAMING_SNAKE_CASE__   =   init
       SCREAMING_SNAKE_CASE__   =   init_range
       SCREAMING_SNAKE_CASE__   =   proj_init_std
       SCREAMING_SNAKE_CASE__   =   init_std
       SCREAMING_SNAKE_CASE__   =   layer_norm_epsilon
       super().__init__(eos_token_id=__lowerCamelCase     ,       **__lowerCamelCase )






  @property
  def 				lowercase_		(							self						:		str )		->							Dict:
       # 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 				lowercase_		(							self						:		List[str]     ,       __lowerCamelCase						:		Any )		->							List[Any]:
       # 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.''' )


