

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


_UpperCamelCase     			=     logging.get_logger(__name__)

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



class        lowercase		(			__A   ):



 '''simple docstring'''


 __SCREAMING_SNAKE_CASE   				=							'''open-llama'''




 def __init__(self			,			__a=100000			,			__a=4096			,			__a=11008			,			__a=32			,			__a=32			,			__a="silu"			,			__a=2048			,			__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			,			)					->   Dict:






  """simple docstring"""





  UpperCAmelCase__     							=							vocab_size
  UpperCAmelCase__     							=							max_position_embeddings
  UpperCAmelCase__     							=							hidden_size
  UpperCAmelCase__     							=							intermediate_size
  UpperCAmelCase__     							=							num_hidden_layers
  UpperCAmelCase__     							=							num_attention_heads
  UpperCAmelCase__     							=							hidden_act
  UpperCAmelCase__     							=							initializer_range
  UpperCAmelCase__     							=							rms_norm_eps
  UpperCAmelCase__     							=							use_cache
  UpperCAmelCase__     							=							kwargs.pop(
      'use_memorry_efficient_attention'			,			UpperCamelCase__					)
  UpperCAmelCase__     							=							hidden_dropout_prob
  UpperCAmelCase__     							=							attention_dropout_prob
  UpperCAmelCase__     							=							use_stable_embedding
  UpperCAmelCase__     							=							shared_input_output_embedding
  UpperCAmelCase__     							=							rope_scaling
  self._rope_scaling_validation()

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




 def     UpperCamelCase__				(self					)					->   str:






  """simple docstring"""





  if self.rope_scaling is None:
   return

  if not isinstance(self.rope_scaling			,			UpperCamelCase__					) 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__     							=							self.rope_scaling.get('type'			,			UpperCamelCase__					)
  UpperCAmelCase__     							=							self.rope_scaling.get('factor'			,			UpperCamelCase__					)
  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(UpperCamelCase__			,			UpperCamelCase__					) 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 __future__ import annotations

from collections.abc import Iterator
from typing import Generic, TypeVar

__lowerCAmelCase        =							TypeVar("T")




class   __SCREAMING_SNAKE_CASE       (Generic[T]       ):


  """simple docstring"""


  def __init__(			self   ,	UpperCamelCase__	):






         """simple docstring"""


         a_						     =			data
         a_						     =			None







  def __str__(			self	):






         """simple docstring"""


         return f'{self.data}'





class   __SCREAMING_SNAKE_CASE       (Generic[T]       ):


  """simple docstring"""


  def __init__(			self	):






         """simple docstring"""


         a_						     =			None







  def __iter__(			self	):






         """simple docstring"""


         a_						     =			self.top
         while node:
                yield node.data
                a_						     =			node.next







  def __str__(			self	):






         """simple docstring"""


         return "->".join([str(UpperCamelCase__	) for item in self]	)







  def __len__(			self	):






         """simple docstring"""


         return len(tuple(iter(self	)	)	)







  def    _a       (			self	):






         """simple docstring"""


         return self.top is None







  def    _a       (			self   ,	UpperCamelCase__	):






         """simple docstring"""


         a_						     =			Node(UpperCamelCase__	)
         if not self.is_empty():
                a_						     =			self.top
         a_						     =			node







  def    _a       (			self	):






         """simple docstring"""


         if self.is_empty():
                raise IndexError('pop from empty stack'	)
         assert isinstance(self.top   ,	UpperCamelCase__	)
         a_						     =			self.top
         a_						     =			self.top.next
         return pop_node.data







  def    _a       (			self	):






         """simple docstring"""


         if self.is_empty():
                raise IndexError('peek from empty stack'	)

         assert self.top is not None
         return self.top.data







  def    _a       (			self	):






         """simple docstring"""


         a_						     =			None


if __name__ == "__main__":
  from doctest import testmod

  testmod()




