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


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

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


class 						a__							(       __snake_case		):
			A__    :       Union[str, Any]        =      'open-llama'



			def __init__(						self				,						UpperCAmelCase=1_0_0_0_0_0				,						UpperCAmelCase=4_0_9_6				,						UpperCAmelCase=1_1_0_0_8				,						UpperCAmelCase=3_2				,						UpperCAmelCase=3_2				,						UpperCAmelCase="silu"				,						UpperCAmelCase=2_0_4_8				,						UpperCAmelCase=0.02				,						UpperCAmelCase=1e-6				,						UpperCAmelCase=True				,						UpperCAmelCase=0				,						UpperCAmelCase=1				,						UpperCAmelCase=2				,						UpperCAmelCase=False				,						UpperCAmelCase=True				,						UpperCAmelCase=0.1				,						UpperCAmelCase=0.1				,						UpperCAmelCase=True				,						UpperCAmelCase=True				,						UpperCAmelCase=None				,						**UpperCAmelCase				,						)			->   Any:
								__a		 =       vocab_size
								__a		 =       max_position_embeddings
								__a		 =       hidden_size
								__a		 =       intermediate_size
								__a		 =       num_hidden_layers
								__a		 =       num_attention_heads
								__a		 =       hidden_act
								__a		 =       initializer_range
								__a		 =       rms_norm_eps
								__a		 =       use_cache
								__a		 =       kwargs.pop(
								    'use_memorry_efficient_attention'				,						UpperCAmelCase   )
								__a		 =       hidden_dropout_prob
								__a		 =       attention_dropout_prob
								__a		 =       use_stable_embedding
								__a		 =       shared_input_output_embedding
								__a		 =       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 __SCREAMING_SNAKE_CASE							(						self   )			->   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}'''   )
								__a		 =       self.rope_scaling.get('type'				,						UpperCAmelCase   )
								__a		 =       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}'''   )





from ..utils import DummyObject, requires_backends


class 						a__							(       metaclass=__snake_case		):
			A__    :       List[Any]        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Any:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Union[str, Any]:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   List[str]:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Union[str, Any]        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Dict:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Dict        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Union[str, Any]:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Any:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Union[str, Any]        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Optional[Any]:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Union[str, Any]:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Dict        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Optional[int]:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Any:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   str:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Tuple        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   List[str]:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Any:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )




