




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  A		(  __UpperCAmelCase     ):
		__snake_case									=   'open-llama'



		def __init__(     self,	UpperCamelCase__=10_0000,	UpperCamelCase__=4096,	UpperCamelCase__=1_1008,	UpperCamelCase__=32,	UpperCamelCase__=32,	UpperCamelCase__="silu",	UpperCamelCase__=2048,	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_      			=  vocab_size
								lowerCAmelCase_      			=  max_position_embeddings
								lowerCAmelCase_      			=  hidden_size
								lowerCAmelCase_      			=  intermediate_size
								lowerCAmelCase_      			=  num_hidden_layers
								lowerCAmelCase_      			=  num_attention_heads
								lowerCAmelCase_      			=  hidden_act
								lowerCAmelCase_      			=  initializer_range
								lowerCAmelCase_      			=  rms_norm_eps
								lowerCAmelCase_      			=  use_cache
								lowerCAmelCase_      			=  kwargs.pop(
								    '''use_memorry_efficient_attention''',	UpperCamelCase__   )
								lowerCAmelCase_      			=  hidden_dropout_prob
								lowerCAmelCase_      			=  attention_dropout_prob
								lowerCAmelCase_      			=  use_stable_embedding
								lowerCAmelCase_      			=  shared_input_output_embedding
								lowerCAmelCase_      			=  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        SCREAMING_SNAKE_CASE__			(     self   ):







								"""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}"   )
								lowerCAmelCase_      			=  self.rope_scaling.get('''type''',	UpperCamelCase__   )
								lowerCAmelCase_      			=  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}"   )










import importlib
import os
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Optional, Union

import torch

from ..utils import BaseOutput


_A     =			'''scheduler_config.json'''


class  A		(  __UpperCAmelCase     ):
		__snake_case									=   1
		__snake_case									=   2
		__snake_case									=   3
		__snake_case									=   4
		__snake_case									=   5
		__snake_case									=   6
		__snake_case									=   7
		__snake_case									=   8
		__snake_case									=   9
		__snake_case									=   10
		__snake_case									=   11
		__snake_case									=   12
		__snake_case									=   13
		__snake_case									=   14







@dataclass
class  A		(  __UpperCAmelCase     ):
		__snake_case									=   42







class  A		:
		__snake_case									=   SCHEDULER_CONFIG_NAME
		__snake_case									=   []
		__snake_case									=   True



		@classmethod
		def        SCREAMING_SNAKE_CASE__			(     cls,	UpperCamelCase__ = None,	UpperCamelCase__ = None,	UpperCamelCase__=False,	**UpperCamelCase__,	):







								"""simple docstring"""



								lowerCAmelCase_			,					lowerCAmelCase_			,					lowerCAmelCase_      			=  cls.load_config(
								    pretrained_model_name_or_path=UpperCamelCase__,	subfolder=UpperCamelCase__,	return_unused_kwargs=UpperCamelCase__,	return_commit_hash=UpperCamelCase__,	**UpperCamelCase__,	)
								return cls.from_config(UpperCamelCase__,	return_unused_kwargs=UpperCamelCase__,	**UpperCamelCase__   )



		def        SCREAMING_SNAKE_CASE__			(     self,	UpperCamelCase__,	UpperCamelCase__ = False,	**UpperCamelCase__   ):







								"""simple docstring"""



								self.save_config(save_directory=UpperCamelCase__,	push_to_hub=UpperCamelCase__,	**UpperCamelCase__   )



		@property
		def        SCREAMING_SNAKE_CASE__			(     self   ):







								"""simple docstring"""



								return self._get_compatibles()







		@classmethod
		def        SCREAMING_SNAKE_CASE__			(     cls   ):







								"""simple docstring"""



								lowerCAmelCase_      			=  list(set([cls.__name__] + cls._compatibles   )   )
								lowerCAmelCase_      			=  importlib.import_module(__name__.split('''.'''   )[0]   )
								lowerCAmelCase_      			=  [
								    getattr(UpperCamelCase__,	UpperCamelCase__   ) for c in compatible_classes_str if hasattr(UpperCamelCase__,	UpperCamelCase__   )
								]
								return compatible_classes




