





'''simple docstring'''




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      UpperCamelCase__					(					lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	'''open-llama'''


					def __init__(						self				:			int      ,						lowerCamelCase_				:			int=10_00_00      ,						lowerCamelCase_				:			str=40_96      ,						lowerCamelCase_				:			List[str]=1_10_08      ,						lowerCamelCase_				:			Dict=32      ,						lowerCamelCase_				:			Union[str, Any]=32      ,						lowerCamelCase_				:			Optional[Any]="silu"      ,						lowerCamelCase_				:			Optional[int]=20_48      ,						lowerCamelCase_				:			Any=0.02      ,						lowerCamelCase_				:			List[str]=1e-6      ,						lowerCamelCase_				:			Dict=True      ,						lowerCamelCase_				:			List[Any]=0      ,						lowerCamelCase_				:			str=1      ,						lowerCamelCase_				:			Tuple=2      ,						lowerCamelCase_				:			Dict=False      ,						lowerCamelCase_				:			Optional[Any]=True      ,						lowerCamelCase_				:			List[Any]=0.1      ,						lowerCamelCase_				:			str=0.1      ,						lowerCamelCase_				:			Tuple=True      ,						lowerCamelCase_				:			Dict=True      ,						lowerCamelCase_				:			Optional[int]=None      ,						**lowerCamelCase_				:			Optional[Any]      ,						):

							'''simple docstring'''



							SCREAMING_SNAKE_CASE :				Dict		=			vocab_size
							SCREAMING_SNAKE_CASE :				Optional[int]		=			max_position_embeddings
							SCREAMING_SNAKE_CASE :				Union[str, Any]		=			hidden_size
							SCREAMING_SNAKE_CASE :				Optional[int]		=			intermediate_size
							SCREAMING_SNAKE_CASE :				List[str]		=			num_hidden_layers
							SCREAMING_SNAKE_CASE :				Optional[int]		=			num_attention_heads
							SCREAMING_SNAKE_CASE :				List[Any]		=			hidden_act
							SCREAMING_SNAKE_CASE :				Dict		=			initializer_range
							SCREAMING_SNAKE_CASE :				List[str]		=			rms_norm_eps
							SCREAMING_SNAKE_CASE :				Dict		=			use_cache
							SCREAMING_SNAKE_CASE :				List[Any]		=			kwargs.pop(
							    """use_memorry_efficient_attention"""      ,						lowerCamelCase_						)
							SCREAMING_SNAKE_CASE :				Dict		=			hidden_dropout_prob
							SCREAMING_SNAKE_CASE :				List[Any]		=			attention_dropout_prob
							SCREAMING_SNAKE_CASE :				List[str]		=			use_stable_embedding
							SCREAMING_SNAKE_CASE :				List[Any]		=			shared_input_output_embedding
							SCREAMING_SNAKE_CASE :				Union[str, Any]		=			rope_scaling
							self._rope_scaling_validation()

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



					def lowerCamelCase_			(						self				:			Optional[int]						):

							'''simple docstring'''



							if self.rope_scaling is None:
									return

							if not isinstance(self.rope_scaling      ,						lowerCamelCase_						) 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}'''						)
							SCREAMING_SNAKE_CASE :				int		=			self.rope_scaling.get("""type"""      ,						lowerCamelCase_						)
							SCREAMING_SNAKE_CASE :				List[Any]		=			self.rope_scaling.get("""factor"""      ,						lowerCamelCase_						)
							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(lowerCamelCase_      ,						lowerCamelCase_						) 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'''




from ..utils import DummyObject, requires_backends




class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Optional[int]      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[int]      ,						*lowerCamelCase_				:			List[Any]      ,						**lowerCamelCase_				:			str						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[str]      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			str						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Dict      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Optional[Any]      ,						*lowerCamelCase_				:			Optional[int]      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			str      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[Any]      ,						*lowerCamelCase_				:			str      ,						**lowerCamelCase_				:			List[Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[Any]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			str      ,						**lowerCamelCase_				:			Optional[Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[str]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			Optional[int]      ,						**lowerCamelCase_				:			str						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Any      ,						*lowerCamelCase_				:			List[Any]      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Union[str, Any]      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			str      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Dict      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Dict						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Tuple      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Optional[Any]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			List[Any]						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			List[str]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[str]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Dict      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			int      ,						*lowerCamelCase_				:			int      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			int      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Optional[Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Optional[int]      ,						**lowerCamelCase_				:			Any						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			List[Any]      ,						*lowerCamelCase_				:			List[Any]      ,						**lowerCamelCase_				:			List[Any]						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Optional[Any]      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Any      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Any      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			int						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Union[str, Any]      ,						**lowerCamelCase_				:			List[str]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[Any]      ,						*lowerCamelCase_				:			Dict      ,						**lowerCamelCase_				:			Optional[Any]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)







class      UpperCamelCase__					(					metaclass=lowercase_			):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__				=	['''flax''']


					def __init__(						self				:			Tuple      ,						*lowerCamelCase_				:			Tuple      ,						**lowerCamelCase_				:			Union[str, Any]						):

							'''simple docstring'''



							requires_backends(self      ,						["""flax"""]						)


					@classmethod
					def lowerCamelCase_			(						cls				:			Optional[Any]      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Optional[int]						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



					@classmethod
					def lowerCamelCase_			(						cls				:			List[Any]      ,						*lowerCamelCase_				:			Any      ,						**lowerCamelCase_				:			Tuple						):

							'''simple docstring'''



							requires_backends(cls      ,						["""flax"""]						)



