


'''simple docstring'''

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


lowerCAmelCase				:str        =      logging.get_logger(__name__)

lowerCAmelCase				:Tuple        =      {}
class _lowerCamelCase	(						__SCREAMING_SNAKE_CASE							):



		'''simple docstring'''







		lowerCAmelCase     :      Union[str, Any]				   =    """llama"""
		lowerCAmelCase     :      Union[str, Any]				   =    ["""past_key_values"""]







		def __init__( self		:						Optional[int]  ,					_A		:						Dict=32000  ,					_A		:						Union[str, Any]=4096  ,					_A		:						int=11008  ,					_A		:						int=32  ,					_A		:						Optional[Any]=32  ,					_A		:						Optional[int]=None  ,					_A		:						Any="silu"  ,					_A		:						List[Any]=2048  ,					_A		:						str=0.02  ,					_A		:						str=1E-6  ,					_A		:						Tuple=True  ,					_A		:						Dict=0  ,					_A		:						int=1  ,					_A		:						Tuple=2  ,					_A		:						Optional[Any]=1  ,					_A		:						Optional[int]=False  ,					_A		:						Optional[Any]=None  ,					**_A		:						Optional[Any]  ,					)  ->			Optional[Any]:
			__magic_name__	:   str					     =					vocab_size
			__magic_name__	:   Any					     =					max_position_embeddings
			__magic_name__	:   int					     =					hidden_size
			__magic_name__	:   Union[str, Any]					     =					intermediate_size
			__magic_name__	:   Union[str, Any]					     =					num_hidden_layers
			__magic_name__	:   Optional[int]					     =					num_attention_heads

			# for backward compatibility
			if num_key_value_heads is None:
				__magic_name__	:   Dict					     =					num_attention_heads

			__magic_name__	:   List[str]					     =					num_key_value_heads
			__magic_name__	:   str					     =					hidden_act
			__magic_name__	:   Tuple					     =					initializer_range
			__magic_name__	:   str					     =					rms_norm_eps
			__magic_name__	:   Dict					     =					pretraining_tp
			__magic_name__	:   Optional[Any]					     =					use_cache
			__magic_name__	:   List[Any]					     =					rope_scaling
			self._rope_scaling_validation()

			super().__init__(
			    pad_token_id=UpperCamelCase__  ,					bos_token_id=UpperCamelCase__  ,					eos_token_id=UpperCamelCase__  ,					tie_word_embeddings=UpperCamelCase__  ,					**UpperCamelCase__  ,					)







		def        __lowerCAmelCase		( self		:						Any      )  ->			List[Any]:







			if self.rope_scaling is None:
				return

			if not isinstance(self.rope_scaling  ,					UpperCamelCase__      ) or len(self.rope_scaling      ) != 2:
				raise ValueError(
				    '`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, '
				    F'got {self.rope_scaling}'      )
			__magic_name__	:   str					     =					self.rope_scaling.get('type'  ,					UpperCamelCase__      )
			__magic_name__	:   Union[str, Any]					     =					self.rope_scaling.get('factor'  ,					UpperCamelCase__      )
			if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
				raise ValueError(
				    F'`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}'      )
			if rope_scaling_factor is None or not isinstance(UpperCamelCase__  ,					UpperCamelCase__      ) or rope_scaling_factor <= 1.0:
				raise ValueError(F'`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}'      )



'''simple docstring'''

def lowerCamelCase      (      lowerCAmelCase    :     int		):





	"""simple docstring"""







	if not isinstance(lowerCAmelCase		,		lowerCAmelCase		):
		__magic_name__	:   int					     =					f'Input value of [number={number}] must be an integer'
		raise TypeError(lowerCAmelCase		)
	if number < 0:
		return False
	__magic_name__	:   Tuple					     =					number * number
	while number > 0:
		if number % 10 != number_square % 10:
			return False
		number //= 10
		number_square //= 10
	return True


if __name__ == "__main__":
							import doctest

							doctest.testmod()