






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


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

lowerCamelCase			:					Union[str, Any]         =	{
    '''transfo-xl-wt103''': '''https://huggingface.co/transfo-xl-wt103/resolve/main/config.json''',
}



class 							_UpperCamelCase			(a_			):
      snake_case_  =							"""transfo-xl"""
      snake_case_  =							["""mems"""]
      snake_case_  =							{
          """n_token""": """vocab_size""",
          """hidden_size""": """d_model""",
          """num_attention_heads""": """n_head""",
          """num_hidden_layers""": """n_layer""",
      }


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


      @property
      def  __UpperCAmelCase		(	self	)->	Union[str, Any]:
           # 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					,						__UpperCamelCase	)->	Optional[int]:
           # 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."""	)














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


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

lowerCamelCase			:					Dict         =	{
    '''microsoft/biogpt''': '''https://huggingface.co/microsoft/biogpt/resolve/main/config.json''',
    # See all BioGPT models at https://huggingface.co/models?filter=biogpt
}



class 							_UpperCamelCase			(a_			):
      snake_case_  =							"""biogpt"""


      def __init__(	self					,						__UpperCamelCase=4_2_3_8_4					,						__UpperCamelCase=1_0_2_4					,						__UpperCamelCase=2_4					,						__UpperCamelCase=1_6					,						__UpperCamelCase=4_0_9_6					,						__UpperCamelCase="gelu"					,						__UpperCamelCase=0.1					,						__UpperCamelCase=0.1					,						__UpperCamelCase=1_0_2_4					,						__UpperCamelCase=0.0_2					,						__UpperCamelCase=1e-12					,						__UpperCamelCase=True					,						__UpperCamelCase=True					,						__UpperCamelCase=0.0					,						__UpperCamelCase=0.0					,						__UpperCamelCase=1					,						__UpperCamelCase=0					,						__UpperCamelCase=2					,						**__UpperCamelCase					,						)->	Optional[Any]:
           __lowerCAmelCase								=					vocab_size
           __lowerCAmelCase								=					max_position_embeddings
           __lowerCAmelCase								=					hidden_size
           __lowerCAmelCase								=					num_hidden_layers
           __lowerCAmelCase								=					num_attention_heads
           __lowerCAmelCase								=					intermediate_size
           __lowerCAmelCase								=					hidden_act
           __lowerCAmelCase								=					hidden_dropout_prob
           __lowerCAmelCase								=					attention_probs_dropout_prob
           __lowerCAmelCase								=					initializer_range
           __lowerCAmelCase								=					layer_norm_eps
           __lowerCAmelCase								=					scale_embedding
           __lowerCAmelCase								=					use_cache
           __lowerCAmelCase								=					layerdrop
           __lowerCAmelCase								=					activation_dropout
           super().__init__(pad_token_id=__UpperCamelCase					,						bos_token_id=__UpperCamelCase					,						eos_token_id=__UpperCamelCase					,						**__UpperCamelCase	)






