'''simple docstring'''






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


__a										=					logging.get_logger(__name__)

__a										=					{
    'abeja/gpt-neox-japanese-2.7b': 'https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json',
}





class     A__							(       UpperCamelCase__   ):





   """simple docstring"""





   UpperCamelCase_       :						List[str]    				=     """gpt_neox_japanese"""




   def __init__( self     :		List[Any]						,     lowerCAmelCase__     :		str=3_2_0_0_0						,     lowerCAmelCase__     :		int=2_5_6_0						,     lowerCAmelCase__     :		Dict=3_2						,     lowerCAmelCase__     :		List[str]=3_2						,     lowerCAmelCase__     :		str=4						,     lowerCAmelCase__     :		List[str]="gelu"						,     lowerCAmelCase__     :		List[str]=1.00						,     lowerCAmelCase__     :		Union[str, Any]=1_0_0_0_0						,     lowerCAmelCase__     :		str=2_0_4_8						,     lowerCAmelCase__     :		Tuple=0.02						,     lowerCAmelCase__     :		List[Any]=1e-5						,     lowerCAmelCase__     :		List[str]=True						,     lowerCAmelCase__     :		str=3_1_9_9_6						,     lowerCAmelCase__     :		Optional[Any]=3_1_9_9_9						,     lowerCAmelCase__     :		Any=0.1						,     lowerCAmelCase__     :		List[Any]=0.0						,     **lowerCAmelCase__     :		str						,     )       ->    Tuple:







      """simple docstring"""




      super().__init__(bos_token_id=__a						,     eos_token_id=__a						,     **__a			)
      _UpperCAmelCase							:	Tuple							=   vocab_size
      _UpperCAmelCase							:	Dict							=   max_position_embeddings
      _UpperCAmelCase							:	Any							=   hidden_size
      _UpperCAmelCase							:	Union[str, Any]							=   num_hidden_layers
      _UpperCAmelCase							:	int							=   num_attention_heads
      _UpperCAmelCase							:	List[Any]							=   intermediate_multiple_size
      _UpperCAmelCase							:	Union[str, Any]							=   hidden_act
      _UpperCAmelCase							:	Dict							=   rotary_pct
      _UpperCAmelCase							:	List[str]							=   rotary_emb_base
      _UpperCAmelCase							:	Optional[int]							=   initializer_range
      _UpperCAmelCase							:	Tuple							=   layer_norm_eps
      _UpperCAmelCase							:	Optional[Any]							=   use_cache
      _UpperCAmelCase							:	int							=   attention_dropout
      _UpperCAmelCase							:	List[Any]							=   hidden_dropout
'''simple docstring'''





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


SCREAMING_SNAKE_CASE_:     Dict  =logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_:     Tuple  ={}




class        __A      ( UpperCamelCase__	):
    a__       :						int          =  """llama"""
    a__       :						Any          =  ["""past_key_values"""]



    def __init__(self    :    List[str]   ,			__a    :    List[str]=32000   ,			__a    :    Tuple=4096   ,			__a    :    List[Any]=11008   ,			__a    :    Dict=32   ,			__a    :    Tuple=32   ,			__a    :    Any=None   ,			__a    :    Any="silu"   ,			__a    :    List[Any]=2048   ,			__a    :    List[Any]=0.02   ,			__a    :    str=1E-6   ,			__a    :    Optional[Any]=True   ,			__a    :    Union[str, Any]=0   ,			__a    :    Any=1   ,			__a    :    Dict=2   ,			__a    :    Dict=1   ,			__a    :    str=False   ,			__a    :    str=None   ,			**__a    :    Optional[Any]   ,			):
         UpperCAmelCase_           =   vocab_size
         UpperCAmelCase_           =   max_position_embeddings
         UpperCAmelCase_           =   hidden_size
         UpperCAmelCase_           =   intermediate_size
         UpperCAmelCase_           =   num_hidden_layers
         UpperCAmelCase_           =   num_attention_heads

         # for backward compatibility
         if num_key_value_heads is None:
              UpperCAmelCase_           =   num_attention_heads

         UpperCAmelCase_           =   num_key_value_heads
         UpperCAmelCase_           =   hidden_act
         UpperCAmelCase_           =   initializer_range
         UpperCAmelCase_           =   rms_norm_eps
         UpperCAmelCase_           =   pretraining_tp
         UpperCAmelCase_           =   use_cache
         UpperCAmelCase_           =   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 					_lowercase						(self    :    List[str] ):
         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}""" )
         UpperCAmelCase_           =   self.rope_scaling.get("type"   ,			__a )
         UpperCAmelCase_           =   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}""" )




