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


lowercase_ 				=			logging.get_logger(__name__)

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





class     __UpperCamelCase (							lowerCAmelCase__       ):






     """simple docstring"""







     lowerCAmelCase_							   =			'''open-llama'''



     def __init__(				self							:							List[str]     ,						_A							:							int=10_0000     ,						_A							:							Dict=4096     ,						_A							:							int=1_1008     ,						_A							:							str=32     ,						_A							:							str=32     ,						_A							:							Dict="silu"     ,						_A							:							List[str]=2048     ,						_A							:							Optional[Any]=0.02     ,						_A							:							Union[str, Any]=1e-6     ,						_A							:							Optional[Any]=True     ,						_A							:							Tuple=0     ,						_A							:							List[Any]=1     ,						_A							:							str=2     ,						_A							:							str=False     ,						_A							:							Any=True     ,						_A							:							List[Any]=0.1     ,						_A							:							Optional[int]=0.1     ,						_A							:							Any=True     ,						_A							:							Any=True     ,						_A							:							Optional[int]=None     ,						**_A							:							Optional[int]     ,						):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		vocab_size
       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		max_position_embeddings
       __SCREAMING_SNAKE_CASE      :	Dict					=		hidden_size
       __SCREAMING_SNAKE_CASE      :	Tuple					=		intermediate_size
       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		num_hidden_layers
       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		num_attention_heads
       __SCREAMING_SNAKE_CASE      :	str					=		hidden_act
       __SCREAMING_SNAKE_CASE      :	Any					=		initializer_range
       __SCREAMING_SNAKE_CASE      :	Dict					=		rms_norm_eps
       __SCREAMING_SNAKE_CASE      :	int					=		use_cache
       __SCREAMING_SNAKE_CASE      :	List[str]					=		kwargs.pop(
           '''use_memorry_efficient_attention'''     ,						_A )
       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		hidden_dropout_prob
       __SCREAMING_SNAKE_CASE      :	str					=		attention_dropout_prob
       __SCREAMING_SNAKE_CASE      :	List[str]					=		use_stable_embedding
       __SCREAMING_SNAKE_CASE      :	Dict					=		shared_input_output_embedding
       __SCREAMING_SNAKE_CASE      :	int					=		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  UpperCAmelCase__							(				self							:							List[str] ):







       """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}''' )
       __SCREAMING_SNAKE_CASE      :	List[str]					=		self.rope_scaling.get('''type'''     ,						_A )
       __SCREAMING_SNAKE_CASE      :	Any					=		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}''' )


__lowerCamelCase				=			{
    0: """0""",
    1: """1""",
    2: """2""",
    3: """3""",
    4: """4""",
    5: """5""",
    6: """6""",
    7: """7""",
    8: """8""",
    9: """9""",
    10: """a""",
    11: """b""",
    12: """c""",
    13: """d""",
    14: """e""",
    15: """f""",
}


def      UpperCamelCase   (       __lowerCamelCase	:					float       ):
       assert type(__lowerCamelCase       ) in (int, float) and decimal == int(__lowerCamelCase       )
       snake_case			:  str     							= int(__lowerCamelCase       )
       snake_case			:  str     							= ""
       snake_case			:  str     							= False
       if decimal < 0:
              snake_case			:  Optional[Any]     							= True
              decimal *= -1
       while decimal > 0:
              snake_case							,   snake_case			:  Union[str, Any]     							= divmod(__lowerCamelCase							,   16       )
              snake_case			:  Tuple     							= values[remainder] + hexadecimal
       snake_case			:  Tuple     							= "0x" + hexadecimal
       if negative:
              snake_case			:  Any     							= "-" + hexadecimal
       return hexadecimal


if __name__ == "__main__":
   import doctest

   doctest.testmod()





