


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


a			:			Tuple												=					logging.get_logger(__name__)

a			:			Dict												=					{
    '''s-JoL/Open-Llama-V1''': '''https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json''',
}
class 						lowerCamelCase_							(					lowerCAmelCase__					):



					'''simple docstring'''







					__UpperCAmelCase							  =					"open-llama"






					def __init__(					self			,							snake_case_=1_0_0_0_0_0			,							snake_case_=4_0_9_6			,							snake_case_=1_1_0_0_8			,							snake_case_=3_2			,							snake_case_=3_2			,							snake_case_="silu"			,							snake_case_=2_0_4_8			,							snake_case_=0.0_2			,							snake_case_=1e-6			,							snake_case_=True			,							snake_case_=0			,							snake_case_=1			,							snake_case_=2			,							snake_case_=False			,							snake_case_=True			,							snake_case_=0.1			,							snake_case_=0.1			,							snake_case_=True			,							snake_case_=True			,							snake_case_=None			,							**snake_case_			,							) ->      Any:







								'''simple docstring'''

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

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






					def A   (					self    ) ->      List[str]:







								'''simple docstring'''

								if self.rope_scaling is None:
											return

								if not isinstance(self.rope_scaling			,							snake_case_    ) 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			       = self.rope_scaling.get('''type'''			,							snake_case_    )
								__lowercase			       = self.rope_scaling.get('''factor'''			,							snake_case_    )
								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(snake_case_			,							snake_case_    ) or rope_scaling_factor <= 1.0:
											raise ValueError(F'`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}'    )






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


a			:			Optional[Any]												=					{
    '''configuration_llama''': ['''LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''LlamaConfig'''],
}

try:
	if not is_sentencepiece_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	a			:			Optional[int]												=					['''LlamaTokenizer''']

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	a			:			Optional[int]												=					['''LlamaTokenizerFast''']

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	a			:			Any												=					[
	    '''LlamaForCausalLM''',
	    '''LlamaModel''',
	    '''LlamaPreTrainedModel''',
	    '''LlamaForSequenceClassification''',
	]


if TYPE_CHECKING:
	from .configuration_llama import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlamaConfig

	try:
		if not is_sentencepiece_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_llama import LlamaTokenizer

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_llama_fast import LlamaTokenizerFast

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_llama import LlamaForCausalLM, LlamaForSequenceClassification, LlamaModel, LlamaPreTrainedModel


else:
	import sys

	a			:			Dict												=					_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


