


import warnings

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


snake_case							:	List[Any]					      =				logging.get_logger(__name__)

snake_case							:	Optional[int]					      =				{
    '''xlnet-base-cased''': '''https://huggingface.co/xlnet-base-cased/resolve/main/config.json''',
    '''xlnet-large-cased''': '''https://huggingface.co/xlnet-large-cased/resolve/main/config.json''',
}







class 	snake_case_       (_UpperCamelCase				):
					UpperCAmelCase__ :   Optional[Any]   				=      'xlnet'
					UpperCAmelCase__ :   int   				=      ['mems']
					UpperCAmelCase__ :   Optional[int]   				=      {
					    'n_token': 'vocab_size',  # Backward compatibility
					    'hidden_size': 'd_model',
					    'num_attention_heads': 'n_head',
					    'num_hidden_layers': 'n_layer',
					}
					def __init__(				self       :Optional[Any]      ,__snake_case       :List[Any]=3_20_00      ,__snake_case       :int=10_24      ,__snake_case       :Optional[Any]=24      ,__snake_case       :str=16      ,__snake_case       :int=40_96      ,__snake_case       :int="gelu"      ,__snake_case       :Any=True      ,__snake_case       :Dict="bi"      ,__snake_case       :List[str]=0.02      ,__snake_case       :str=1E-12      ,__snake_case       :Union[str, Any]=0.1      ,__snake_case       :int=5_12      ,__snake_case       :List[str]=None      ,__snake_case       :List[Any]=True      ,__snake_case       :Optional[int]=False      ,__snake_case       :Tuple=False      ,__snake_case       :List[Any]=-1      ,__snake_case       :Optional[Any]=False      ,__snake_case       :List[str]="last"      ,__snake_case       :Dict=True      ,__snake_case       :Tuple="tanh"      ,__snake_case       :str=0.1      ,__snake_case       :List[Any]=5      ,__snake_case       :str=5      ,__snake_case       :Dict=5      ,__snake_case       :Optional[int]=1      ,__snake_case       :List[Any]=2      ,**__snake_case       :Optional[Any]      ,) ->   str:
												a__					=					vocab_size
												a__					=					d_model
												a__					=					n_layer
												a__					=					n_head
												if d_model % n_head != 0:
																			raise ValueError(F'\'d_model % n_head\' ({d_model % n_head}) should be equal to 0'				)
												if "d_head" in kwargs:
																			if kwargs["d_head"] != d_model // n_head:
																										raise ValueError(
																										    F'`d_head` ({kwargs["d_head"]}) should be equal to `d_model // n_head` ({d_model // n_head})'				)
												a__					=					d_model // n_head
												a__					=					ff_activation
												a__					=					d_inner
												a__					=					untie_r
												a__					=					attn_type

												a__					=					initializer_range
												a__					=					layer_norm_eps

												a__					=					dropout
												a__					=					mem_len
												a__					=					reuse_len
												a__					=					bi_data
												a__					=					clamp_len
												a__					=					same_length

												a__					=					summary_type
												a__					=					summary_use_proj
												a__					=					summary_activation
												a__					=					summary_last_dropout
												a__					=					start_n_top
												a__					=					end_n_top

												a__					=					bos_token_id
												a__					=					pad_token_id
												a__					=					eos_token_id

												if "use_cache" in kwargs:
																			warnings.warn(
																			    'The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`'
																			    ' instead.'      ,_UpperCAmelCase      ,)
																			a__					=					kwargs['use_cache']

												a__					=					use_mems_eval
												a__					=					use_mems_train
												super().__init__(pad_token_id=_UpperCAmelCase      ,bos_token_id=_UpperCAmelCase      ,eos_token_id=_UpperCAmelCase      ,**_UpperCAmelCase				)
					@property
					def 			lowerCamelCase__(				self       :Optional[Any]				) ->   List[str]:
												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 			lowerCamelCase__(				self       :List[str]      ,__snake_case       :List[str]				) ->   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.'				)










from __future__ import annotations






def 							__lowercase       (			__lowerCAmelCase							:    float ,   __lowerCAmelCase							:    float ,   __lowerCAmelCase							:    float       ):
							if (voltage, current, resistance).count(0       ) != 1:
														raise ValueError('One and only one argument must be 0'       )
							if resistance < 0:
														raise ValueError('Resistance cannot be negative'       )
							if voltage == 0:
														return {"voltage": float(current * resistance       )}
							elif current == 0:
														return {"current": voltage / resistance}
							elif resistance == 0:
														return {"resistance": voltage / current}
							else:
														raise ValueError('Exactly one argument must be 0'       )


if __name__ == "__main__":
						import doctest

						doctest.testmod()




