'''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       UpperCAmelCase__  (       _snake_case			):






   """simple docstring"""
   A							:       Optional[Any]     =    '''open-llama'''
   def __init__(self       ,				_a=100_000       ,				_a=4_096       ,				_a=11_008       ,				_a=32       ,				_a=32       ,				_a="silu"       ,				_a=2_048       ,				_a=0.02       ,				_a=1e-6       ,				_a=True       ,				_a=0       ,				_a=1       ,				_a=2       ,				_a=False       ,				_a=True       ,				_a=0.1       ,				_a=0.1       ,				_a=True       ,				_a=True       ,				_a=None       ,				**_a       ,				)    ->     str:
        lowercase_					:       List[Any]     				=					vocab_size
        lowercase_					:       Union[str, Any]     				=					max_position_embeddings
        lowercase_					:       List[str]     				=					hidden_size
        lowercase_					:       Optional[Any]     				=					intermediate_size
        lowercase_					:       Optional[int]     				=					num_hidden_layers
        lowercase_					:       Any     				=					num_attention_heads
        lowercase_					:       List[Any]     				=					hidden_act
        lowercase_					:       Dict     				=					initializer_range
        lowercase_					:       List[str]     				=					rms_norm_eps
        lowercase_					:       Optional[int]     				=					use_cache
        lowercase_					:       Optional[Any]     				=					kwargs.pop(
            'use_memorry_efficient_attention'       ,				_a				)
        lowercase_					:       Optional[Any]     				=					hidden_dropout_prob
        lowercase_					:       str     				=					attention_dropout_prob
        lowercase_					:       List[str]     				=					use_stable_embedding
        lowercase_					:       int     				=					shared_input_output_embedding
        lowercase_					:       Union[str, Any]     				=					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 		_lowerCamelCase (self				)    ->     int:
        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}'''				)
        lowercase_					:       int     				=					self.rope_scaling.get('type'       ,				_a				)
        lowercase_					:       Optional[int]     				=					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}'''				)







'''simple docstring'''




from decimal import Decimal, getcontext
from math import ceil, factorial

def _UpperCamelCase   (       SCREAMING_SNAKE_CASE_							):

     if not isinstance(SCREAMING_SNAKE_CASE_  ,       SCREAMING_SNAKE_CASE_							):
          raise TypeError('Undefined for non-integers'							)
     elif precision < 1:
          raise ValueError('Undefined for non-natural numbers'							)

     lowercase_					:       str     				=					precision
     lowercase_					:       List[str]     				=					ceil(precision / 14							)
     lowercase_					:       Union[str, Any]     				=					426_880 * Decimal(10_005							).sqrt()
     lowercase_					:       List[Any]     				=					1
     lowercase_					:       Optional[int]     				=					13_591_409
     lowercase_					:       Dict     				=					Decimal(SCREAMING_SNAKE_CASE_							)
     for k in range(1  ,       SCREAMING_SNAKE_CASE_							):
          lowercase_					:       List[str]     				=					factorial(6 * k							) // (factorial(3 * k							) * factorial(SCREAMING_SNAKE_CASE_							) ** 3)
          linear_term += 545_140_134
          exponential_term *= -262_537_412_640_768_000
          partial_sum += Decimal(multinomial_term * linear_term							) / exponential_term
     return str(constant_term / partial_sum							)[:-1]


if __name__ == "__main__":
 _A								=   5_0
 print(F"""The first {n} digits of pi is: {pi(n)}""")




