


"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE :    Any									=				logging.get_logger(__name__)

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



class 			_UpperCAmelCase (							__snake_case				):






		'''simple docstring'''

		lowerCamelCase__				='open-llama'



		def __init__(self				,       a_=10_00_00				,       a_=40_96				,       a_=1_10_08				,       a_=32				,       a_=32				,       a_="silu"				,       a_=20_48				,       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_				,       ):





			'''simple docstring'''

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





			'''simple docstring'''

			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}"""					)
			__snake_case	:						Tuple						=				self.rope_scaling.get('''type'''				,       a_					)
			__snake_case	:						List[str]						=				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"""
import pytest

import datasets


# Import fixture modules as plugins
SCREAMING_SNAKE_CASE :    List[Any]									=				["""tests.fixtures.files""", """tests.fixtures.hub""", """tests.fixtures.fsspec"""]






def 		lowercase							(     _snake_case						:      Optional[int]     ,   _snake_case						:      Optional[int]     )     ->Tuple:
	"""simple docstring"""





	for item in items:
		if any(marker in item.keywords for marker in ['''integration''', '''unit''']     ):
			continue
		item.add_marker(pytest.mark.unit     )






def 		lowercase							(     _snake_case						:      List[str]     )     ->Optional[int]:
	"""simple docstring"""





	config.addinivalue_line('''markers'''     ,   '''torchaudio_latest: mark test to run with torchaudio>=0.12'''     )






@pytest.fixture(autouse=_snake_case     )
def 		lowercase							(     _snake_case						:      Optional[Any]     ,   _snake_case						:      Dict     )     ->Any:
	"""simple docstring"""





	__snake_case	:						List[Any]						=				tmp_path_factory.getbasetemp() / '''cache'''
	__snake_case	:						int						=				test_hf_cache_home / '''datasets'''
	__snake_case	:						Tuple						=				test_hf_cache_home / '''metrics'''
	__snake_case	:						List[str]						=				test_hf_cache_home / '''modules'''
	monkeypatch.setattr('''datasets.config.HF_DATASETS_CACHE'''     ,   str(_snake_case     )     )
	monkeypatch.setattr('''datasets.config.HF_METRICS_CACHE'''     ,   str(_snake_case     )     )
	monkeypatch.setattr('''datasets.config.HF_MODULES_CACHE'''     ,   str(_snake_case     )     )
	__snake_case	:						Optional[int]						=				test_hf_datasets_cache / '''downloads'''
	monkeypatch.setattr('''datasets.config.DOWNLOADED_DATASETS_PATH'''     ,   str(_snake_case     )     )
	__snake_case	:						Tuple						=				test_hf_datasets_cache / '''downloads''' / '''extracted'''
	monkeypatch.setattr('''datasets.config.EXTRACTED_DATASETS_PATH'''     ,   str(_snake_case     )     )






@pytest.fixture(autouse=_snake_case     ,   scope='''session'''     )
def 		lowercase							(     )     ->Any:
	"""simple docstring"""





	datasets.disable_progress_bar()






@pytest.fixture(autouse=_snake_case     )
def 		lowercase							(     _snake_case						:      Tuple     )     ->Union[str, Any]:
	"""simple docstring"""





	monkeypatch.setattr('''datasets.config.HF_UPDATE_DOWNLOAD_COUNTS'''     ,   _snake_case     )






@pytest.fixture
def 		lowercase							(     _snake_case						:      Any     )     ->Optional[Any]:
	"""simple docstring"""





	monkeypatch.setattr('''sqlalchemy.util.deprecations.SILENCE_UBER_WARNING'''     ,   _snake_case     )





