

'''simple docstring'''





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


A_	= logging.get_logger(__name__)

A_	= {"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/config.json"}


class  UpperCAmelCase (							UpperCAmelCase__    ):

		'''simple docstring'''






		SCREAMING_SNAKE_CASE_           =					'openai-gpt'
		SCREAMING_SNAKE_CASE_           =					{
		    'max_position_embeddings': 'n_positions',
		    'hidden_size': 'n_embd',
		    'num_attention_heads': 'n_head',
		    'num_hidden_layers': 'n_layer',
		}
		def __init__(					self   ,			SCREAMING_SNAKE_CASE_=40478   ,			SCREAMING_SNAKE_CASE_=512   ,			SCREAMING_SNAKE_CASE_=768   ,			SCREAMING_SNAKE_CASE_=12   ,			SCREAMING_SNAKE_CASE_=12   ,			SCREAMING_SNAKE_CASE_="gelu"   ,			SCREAMING_SNAKE_CASE_=0.1   ,			SCREAMING_SNAKE_CASE_=0.1   ,			SCREAMING_SNAKE_CASE_=0.1   ,			SCREAMING_SNAKE_CASE_=1E-5   ,			SCREAMING_SNAKE_CASE_=0.02   ,			SCREAMING_SNAKE_CASE_="cls_index"   ,			SCREAMING_SNAKE_CASE_=True   ,			SCREAMING_SNAKE_CASE_=None   ,			SCREAMING_SNAKE_CASE_=True   ,			SCREAMING_SNAKE_CASE_=0.1   ,			**SCREAMING_SNAKE_CASE_   ,			)  ->     List[Any]:






							'''simple docstring'''



							lowerCamelCase_  				=      vocab_size
							lowerCamelCase_  				=      n_positions
							lowerCamelCase_  				=      n_embd
							lowerCamelCase_  				=      n_layer
							lowerCamelCase_  				=      n_head
							lowerCamelCase_  				=      afn
							lowerCamelCase_  				=      resid_pdrop
							lowerCamelCase_  				=      embd_pdrop
							lowerCamelCase_  				=      attn_pdrop
							lowerCamelCase_  				=      layer_norm_epsilon
							lowerCamelCase_  				=      initializer_range
							lowerCamelCase_  				=      summary_type
							lowerCamelCase_  				=      summary_use_proj
							lowerCamelCase_  				=      summary_activation
							lowerCamelCase_  				=      summary_first_dropout
							lowerCamelCase_  				=      summary_proj_to_labels
							super().__init__(**SCREAMING_SNAKE_CASE_		)







'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


__SCREAMING_SNAKE_CASE					:				Tuple									=		logging.get_logger(__name__)

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






class 					__lowerCAmelCase   (   lowercase						):

						"""simple docstring"""






						_UpperCAmelCase		:       Optional[Any]   						="transfo-xl"
						_UpperCAmelCase		:       str   						=["mems"]
						_UpperCAmelCase		:       Optional[int]   						={
						    "n_token": "vocab_size",
						    "hidden_size": "d_model",
						    "num_attention_heads": "n_head",
						    "num_hidden_layers": "n_layer",
						}






						def __init__(  self							:      str ,  lowerCAmelCase							:      Tuple=26_77_35 ,  lowerCAmelCase							:      List[Any]=[2_00_00, 4_00_00, 20_00_00] ,  lowerCAmelCase							:      Dict=10_24 ,  lowerCAmelCase							:      List[str]=10_24 ,  lowerCAmelCase							:      int=16 ,  lowerCAmelCase							:      Optional[Any]=64 ,  lowerCAmelCase							:      str=40_96 ,  lowerCAmelCase							:      Optional[int]=4 ,  lowerCAmelCase							:      Any=False ,  lowerCAmelCase							:      List[str]=18 ,  lowerCAmelCase							:      Any=16_00 ,  lowerCAmelCase							:      List[str]=10_00 ,  lowerCAmelCase							:      int=True ,  lowerCAmelCase							:      List[str]=True ,  lowerCAmelCase							:      List[str]=0 ,  lowerCAmelCase							:      Tuple=-1 ,  lowerCAmelCase							:      Optional[int]=True ,  lowerCAmelCase							:      List[str]=0.1 ,  lowerCAmelCase							:      int=0.0 ,  lowerCAmelCase							:      Tuple=True ,  lowerCAmelCase							:      List[str]="normal" ,  lowerCAmelCase							:      Tuple=0.0_1 ,  lowerCAmelCase							:      Optional[int]=0.0_1 ,  lowerCAmelCase							:      List[Any]=0.0_2 ,  lowerCAmelCase							:      Dict=1e-5 ,  lowerCAmelCase							:      Optional[int]=0 ,  **lowerCAmelCase							:      List[str] ,  ):
													A_			    =		vocab_size
													A_			    =		[]
													self.cutoffs.extend(lowerCAmelCase	)
													if proj_share_all_but_first:
																				A_			    =		[False] + [True] * len(self.cutoffs	)
													else:
																				A_			    =		[False] + [False] * len(self.cutoffs	)
													A_			    =		d_model
													A_			    =		d_embed
													A_			    =		d_head
													A_			    =		d_inner
													A_			    =		div_val
													A_			    =		pre_lnorm
													A_			    =		n_layer
													A_			    =		n_head
													A_			    =		mem_len
													A_			    =		same_length
													A_			    =		attn_type
													A_			    =		clamp_len
													A_			    =		sample_softmax
													A_			    =		adaptive
													A_			    =		dropout
													A_			    =		dropatt
													A_			    =		untie_r
													A_			    =		init
													A_			    =		init_range
													A_			    =		proj_init_std
													A_			    =		init_std
													A_			    =		layer_norm_epsilon
													super().__init__(eos_token_id=lowerCAmelCase ,  **lowerCAmelCase	)






						@property
						def 				_UpperCAmelCase       (  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 				_UpperCAmelCase       (  self							:      Tuple ,  lowerCAmelCase							:      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."	)





