




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


UpperCamelCase__         =      logging.get_logger(__name__)

UpperCamelCase__         =      {
    """s-JoL/Open-Llama-V1""": """https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json""",
}
class       a__   ( snake_case__				):
						_a							:   str =   """open-llama"""






						def __init__(       self		,      _A=1_0_0_0_0_0		,      _A=4_0_9_6		,      _A=1_1_0_0_8		,      _A=3_2		,      _A=3_2		,      _A="silu"		,      _A=2_0_4_8		,      _A=0.02		,      _A=1E-6		,      _A=True		,      _A=0		,      _A=1		,      _A=2		,      _A=False		,      _A=True		,      _A=0.1		,      _A=0.1		,      _A=True		,      _A=True		,      _A=None		,      **_A		,      ):




											"""simple docstring"""



											__lowerCAmelCase           =	vocab_size
											__lowerCAmelCase           =	max_position_embeddings
											__lowerCAmelCase           =	hidden_size
											__lowerCAmelCase           =	intermediate_size
											__lowerCAmelCase           =	num_hidden_layers
											__lowerCAmelCase           =	num_attention_heads
											__lowerCAmelCase           =	hidden_act
											__lowerCAmelCase           =	initializer_range
											__lowerCAmelCase           =	rms_norm_eps
											__lowerCAmelCase           =	use_cache
											__lowerCAmelCase           =	kwargs.pop(
											    "use_memorry_efficient_attention"		,      _A      )
											__lowerCAmelCase           =	hidden_dropout_prob
											__lowerCAmelCase           =	attention_dropout_prob
											__lowerCAmelCase           =	use_stable_embedding
											__lowerCAmelCase           =	shared_input_output_embedding
											__lowerCAmelCase           =	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     __SCREAMING_SNAKE_CASE(       self      ):




											"""simple docstring"""



											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}"""      )
											__lowerCAmelCase           =	self.rope_scaling.get("type"		,      _A      )
											__lowerCAmelCase           =	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}"""      )












import math







def      _a				(						SCREAMING_SNAKE_CASE_							:    int					):

					if 1 < number < 4:
										# 2 and 3 are primes
										return True
					elif number < 2 or number % 2 == 0 or number % 3 == 0:
										# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
										return False

					# All primes number are in format of 6k +/- 1
					for i in range(5				,				int(math.sqrt(SCREAMING_SNAKE_CASE_					) + 1					)				,				6					):
										if number % i == 0 or number % (i + 2) == 0:
															return False
					return True







def      _a				(						SCREAMING_SNAKE_CASE_							:    int = 1_00_01					):

					try:
										__lowerCAmelCase           =	int(SCREAMING_SNAKE_CASE_					)
					except (TypeError, ValueError):
										raise TypeError("Parameter nth must be int or castable to int."					) from None
					if nth <= 0:
										raise ValueError("Parameter nth must be greater than or equal to one."					)
					__lowerCAmelCase           =	[]
					__lowerCAmelCase           =	2
					while len(SCREAMING_SNAKE_CASE_					) < nth:
										if is_prime(SCREAMING_SNAKE_CASE_					):
															primes.append(SCREAMING_SNAKE_CASE_					)
															num += 1
										else:
															num += 1
					return primes[len(SCREAMING_SNAKE_CASE_					) - 1]


if __name__ == "__main__":
					print(f'''{solution() = }''')




