





"""simple docstring"""





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


__A											=		logging.get_logger(__name__)

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






class 					_lowerCAmelCase   (     lowerCamelCase__       ):
       """simple docstring"""




       __magic_name__     :Dict		  =					'''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    , ):



         '''simple docstring'''

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



         '''simple docstring'''

         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}"      )
         lowerCAmelCase__			:Dict											=							self.rope_scaling.get('type'    , lowerCAmelCase__      )
         lowerCAmelCase__			:str											=							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'''




import string


def 				lowerCAmelCase_   (	_lowerCamelCase:   str					):
		__SCREAMING_SNAKE_CASE       :		Dict           =		""""""
		for i in sequence:
				__SCREAMING_SNAKE_CASE       :		Any           =		ord(_lowerCamelCase					)
				if 65 <= extract <= 90:
						output += chr(1_55 - extract					)
				elif 97 <= extract <= 1_22:
						output += chr(2_19 - extract					)
				else:
						output += i
		return output


def 				lowerCAmelCase_   (	_lowerCamelCase:   str					):
		__SCREAMING_SNAKE_CASE       :		Optional[Any]           =		string.ascii_letters
		__SCREAMING_SNAKE_CASE       :		Union[str, Any]           =		string.ascii_lowercase[::-1] + string.ascii_uppercase[::-1]
		return "".join(
		    letters_reversed[letters.index(_lowerCamelCase					)] if c in letters else c for c in sequence					)


def 				lowerCAmelCase_   (	):
		from timeit import timeit

		print("""Running performance benchmarks..."""					)
		__SCREAMING_SNAKE_CASE       :		Union[str, Any]           =		"""from string import printable ; from __main__ import atbash, atbash_slow"""
		print(F"> atbash_slow(): {timeit('atbash_slow(printable)'       ,      setup=_lowerCamelCase					)} seconds"					)
		print(F">      atbash(): {timeit('atbash(printable)'       ,      setup=_lowerCamelCase					)} seconds"					)


if __name__ == "__main__":
						for example in ("ABCDEFGH", "123GGjj", "testStringtest", "with space"):
												print(f"{example} encrypted in atbash: {atbash(example)}")
						benchmark()