

'''simple docstring'''


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


lowerCAmelCase__						:       str										=						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			(				SCREAMING_SNAKE_CASE       ):






						"""simple docstring"""




						__UpperCAmelCase			     =    """open-llama"""







						def __init__(							self					:      Dict			,			snake_case_					:      str=1_0_0_0_0_0			,			snake_case_					:      Union[str, Any]=4_0_9_6			,			snake_case_					:      Optional[int]=1_1_0_0_8			,			snake_case_					:      Any=3_2			,			snake_case_					:      Union[str, Any]=3_2			,			snake_case_					:      List[Any]="silu"			,			snake_case_					:      Union[str, Any]=2_0_4_8			,			snake_case_					:      Tuple=0.0_2			,			snake_case_					:      List[Any]=1e-6			,			snake_case_					:      List[Any]=True			,			snake_case_					:      int=0			,			snake_case_					:      Dict=1			,			snake_case_					:      List[Any]=2			,			snake_case_					:      Union[str, Any]=False			,			snake_case_					:      List[str]=True			,			snake_case_					:      Dict=0.1			,			snake_case_					:      List[Any]=0.1			,			snake_case_					:      Optional[int]=True			,			snake_case_					:      List[str]=True			,			snake_case_					:      List[str]=None			,			**snake_case_					:      str			,			):



								'''simple docstring'''



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

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







						def       __magic_name__							(							self					:      Optional[int]  ):



								'''simple docstring'''



								if self.rope_scaling is None:
										return

								if not isinstance(self.rope_scaling			,			snake_case_  ) 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}"""  )
								snake_case__						:       str       						=  self.rope_scaling.get('''type'''			,			snake_case_  )
								snake_case__						:       Union[str, Any]       						=  self.rope_scaling.get('''factor'''			,			snake_case_  )
								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(snake_case_			,			snake_case_  ) 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 ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCAmelCase__						:       Dict										=						logging.get_logger(__name__)

lowerCAmelCase__						:       Tuple										=						{"""ctrl""": """https://huggingface.co/ctrl/resolve/main/config.json"""}




class     a			(				SCREAMING_SNAKE_CASE       ):






						"""simple docstring"""




						__UpperCAmelCase			     =    """ctrl"""
						__UpperCAmelCase			     =    ["""past_key_values"""]
						__UpperCAmelCase			     =    {
						    """max_position_embeddings""": """n_positions""",
						    """hidden_size""": """n_embd""",
						    """num_attention_heads""": """n_head""",
						    """num_hidden_layers""": """n_layer""",
						}







						def __init__(							self					:      Tuple			,			snake_case_					:      Dict=2_4_6_5_3_4			,			snake_case_					:      Optional[int]=2_5_6			,			snake_case_					:      Dict=1_2_8_0			,			snake_case_					:      Union[str, Any]=8_1_9_2			,			snake_case_					:      Any=4_8			,			snake_case_					:      List[Any]=1_6			,			snake_case_					:      Optional[Any]=0.1			,			snake_case_					:      Union[str, Any]=0.1			,			snake_case_					:      Optional[Any]=1e-6			,			snake_case_					:      List[Any]=0.0_2			,			snake_case_					:      Dict=True			,			**snake_case_					:      List[Any]			,			):



								'''simple docstring'''



								snake_case__						:       Any       						=  vocab_size
								snake_case__						:       int       						=  n_positions
								snake_case__						:       Optional[int]       						=  n_embd
								snake_case__						:       str       						=  n_layer
								snake_case__						:       Any       						=  n_head
								snake_case__						:       str       						=  dff
								snake_case__						:       Any       						=  resid_pdrop
								snake_case__						:       Tuple       						=  embd_pdrop
								snake_case__						:       List[str]       						=  layer_norm_epsilon
								snake_case__						:       int       						=  initializer_range

								snake_case__						:       Optional[int]       						=  use_cache

								super().__init__(**snake_case_  )



