






"""simple docstring"""



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


__A		:       Union[str, Any]  				=		logging.get_logger(__name__)

__A		:       int  				=		{
    '''s-JoL/Open-Llama-V1''': '''https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json''',
}





class 					_UpperCAmelCase       ( _A							):
					SCREAMING_SNAKE_CASE_		:				List[str]							    =   "open-llama"




					def __init__(				self     :						Dict    ,						A     :						Optional[Any]=10_00_00    ,						A     :						Optional[int]=40_96    ,						A     :						Tuple=1_10_08    ,						A     :						List[Any]=32    ,						A     :						Optional[Any]=32    ,						A     :						List[str]="silu"    ,						A     :						Optional[int]=20_48    ,						A     :						Dict=0.02    ,						A     :						Tuple=1e-6    ,						A     :						Optional[int]=True    ,						A     :						Dict=0    ,						A     :						Any=1    ,						A     :						Optional[Any]=2    ,						A     :						Tuple=False    ,						A     :						Dict=True    ,						A     :						Dict=0.1    ,						A     :						int=0.1    ,						A     :						Optional[Any]=True    ,						A     :						List[str]=True    ,						A     :						int=None    ,						**A     :						Optional[int]    ,						)  ->  int:
							lowercase_ : Tuple							       =   vocab_size
							lowercase_ : Tuple							       =   max_position_embeddings
							lowercase_ : int							       =   hidden_size
							lowercase_ : Any							       =   intermediate_size
							lowercase_ : Dict							       =   num_hidden_layers
							lowercase_ : str							       =   num_attention_heads
							lowercase_ : Optional[Any]							       =   hidden_act
							lowercase_ : List[Any]							       =   initializer_range
							lowercase_ : Optional[Any]							       =   rms_norm_eps
							lowercase_ : List[str]							       =   use_cache
							lowercase_ : Dict							       =   kwargs.pop(
							    '''use_memorry_efficient_attention'''    ,						A   )
							lowercase_ : List[Any]							       =   hidden_dropout_prob
							lowercase_ : Tuple							       =   attention_dropout_prob
							lowercase_ : Tuple							       =   use_stable_embedding
							lowercase_ : Optional[int]							       =   shared_input_output_embedding
							lowercase_ : Optional[int]							       =   rope_scaling
							self._rope_scaling_validation()

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






					def   A  (				self     :						Optional[int]   )  ->  List[Any]:
							if self.rope_scaling is None:
									return

							if not isinstance(self.rope_scaling    ,						A   ) 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}'''   )
							lowercase_ : Any							       =   self.rope_scaling.get('''type'''    ,						A   )
							lowercase_ : int							       =   self.rope_scaling.get('''factor'''    ,						A   )
							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(A    ,						A   ) 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'''







_lowercase :  int    							=       [sum(int(c, 1_0) ** 2 for c in i.__str__()) for i in range(1_0_0_0_0_0)]
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: int							):



						"""simple docstring"""





						lowercase_	:     Optional[int]													=       0
						while number:
												# Increased Speed Slightly by checking every 5 digits together.
												sum_of_digits_squared += DIGITS_SQUARED[number % 100000]
												number //= 100000

						return sum_of_digits_squared


# There are 2 Chains made,
# One ends with 89 with the chain member 58 being the one which when declared first,
# there will be the least number of iterations for all the members to be checked.

# The other one ends with 1 and has only one element 1.

# So 58 and 1 are chosen to be declared at the starting.

# Changed dictionary to an array to quicken the solution
_lowercase :  list[bool | None]    							=       [None] * 1_0_0_0_0_0_0_0
_lowercase :  List[str]    							=       True
_lowercase :  Optional[int]    							=       False
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: int							):



						"""simple docstring"""





						if CHAINS[number - 1] is not None:
												return CHAINS[number - 1]  # type: ignore

						lowercase_	:     Tuple													=       chain(next_number(__SCREAMING_SNAKE_CASE							)							)
						lowercase_	:     Union[str, Any]													=       number_chain

						while number < 10000000:
												lowercase_	:     int													=       number_chain
												number *= 10

						return number_chain
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: int = 10000000							):



						"""simple docstring"""





						for i in range(1      ,      __SCREAMING_SNAKE_CASE							):
												if CHAINS[i] is None:
																		chain(i + 1							)

						return CHAINS[:number].count(__SCREAMING_SNAKE_CASE							)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							print(f"""{solution() = }""")



