






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


A_						:						str						      =					logging.get_logger(__name__)

A_						:						Union[str, Any]						      =					{
    's-JoL/Open-Llama-V1': 'https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json',
}




class 							_lowerCAmelCase(			UpperCAmelCase_   ):





       """simple docstring"""







       a							:						Tuple										='''open-llama'''





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




"""simple docstring"""




def 		__snake_case		( SCREAMING_SNAKE_CASE__      :		str							)    ->  bool:





     '''simple docstring'''

     _UpperCAmelCase     :      str														=       0
     for ch in input_str:
          _UpperCAmelCase     :      Optional[int]														=       ord(SCREAMING_SNAKE_CASE__							)
          _UpperCAmelCase     :      int														=       pow(2		,    SCREAMING_SNAKE_CASE__							)

          # If we already turned on bit for current character's unicode
          if bitmap >> ch_unicode & 1 == 1:
               return False
          bitmap |= ch_bit_index_on
     return True


if __name__ == "__main__":
 import doctest

 doctest.testmod()
