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


lowercase  :					str													=       logging.get_logger(__name__)

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




class  lowerCamelCase__							(				__lowercase):




	'''simple docstring'''




	_A								=     'open-llama'







	def __init__(					self		:str     ,   a		:List[Any]=1_0_0_0_0_0     ,   a		:str=4_0_9_6     ,   a		:Optional[int]=1_1_0_0_8     ,   a		:Any=3_2     ,   a		:int=3_2     ,   a		:int="silu"     ,   a		:Optional[int]=2_0_4_8     ,   a		:List[str]=0.02     ,   a		:Union[str, Any]=1E-6     ,   a		:int=True     ,   a		:Union[str, Any]=0     ,   a		:int=1     ,   a		:Tuple=2     ,   a		:Dict=False     ,   a		:Union[str, Any]=True     ,   a		:Union[str, Any]=0.1     ,   a		:Dict=0.1     ,   a		:Tuple=True     ,   a		:Dict=True     ,   a		:int=None     ,   **a		:List[str]     ,   )		-> Optional[Any]:
								__UpperCamelCase	:   Tuple			   =					vocab_size
								__UpperCamelCase	:   int			   =					max_position_embeddings
								__UpperCamelCase	:   Optional[int]			   =					hidden_size
								__UpperCamelCase	:   Any			   =					intermediate_size
								__UpperCamelCase	:   List[str]			   =					num_hidden_layers
								__UpperCamelCase	:   Tuple			   =					num_attention_heads
								__UpperCamelCase	:   Union[str, Any]			   =					hidden_act
								__UpperCamelCase	:   Union[str, Any]			   =					initializer_range
								__UpperCamelCase	:   Tuple			   =					rms_norm_eps
								__UpperCamelCase	:   Optional[int]			   =					use_cache
								__UpperCamelCase	:   str			   =					kwargs.pop(
								    "use_memorry_efficient_attention"     ,   __lowerCAmelCase						)
								__UpperCamelCase	:   Optional[int]			   =					hidden_dropout_prob
								__UpperCamelCase	:   Dict			   =					attention_dropout_prob
								__UpperCamelCase	:   Union[str, Any]			   =					use_stable_embedding
								__UpperCamelCase	:   Any			   =					shared_input_output_embedding
								__UpperCamelCase	:   Tuple			   =					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		:Dict						)		-> Tuple:







								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}'						)
								__UpperCamelCase	:   Union[str, Any]			   =					self.rope_scaling.get("type"     ,   __lowerCAmelCase						)
								__UpperCamelCase	:   int			   =					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}'						)






def lowerCAmelCase__(__snake_case							)				->      str:







	'''simple docstring'''







	return "".join(chr(ord(__snake_case							) - 32							) if '''a''' <= char <= '''z''' else char for char in word							)


if __name__ == "__main__":
			from doctest import testmod

			testmod()



