



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



			def __init__(						self       :  List[Any]			,		A       :  Dict=10_00_00			,		A       :  List[str]=40_96			,		A       :  List[str]=1_10_08			,		A       :  Optional[int]=32			,		A       :  List[Any]=32			,		A       :  Dict="silu"			,		A       :  List[str]=20_48			,		A       :  str=0.0_2			,		A       :  Union[str, Any]=1E-6			,		A       :  Optional[Any]=True			,		A       :  Tuple=0			,		A       :  str=1			,		A       :  Tuple=2			,		A       :  Optional[int]=False			,		A       :  List[str]=True			,		A       :  Dict=0.1			,		A       :  str=0.1			,		A       :  int=True			,		A       :  Tuple=True			,		A       :  Optional[int]=None			,		**A       :  List[Any]			,		)       ->   Optional[int]:



						"""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'			,		A)
						_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=A			,		bos_token_id=A			,		eos_token_id=A			,		tie_word_embeddings=A			,		**A			,		)



			def    _lowerCamelCase	(						self       :  List[Any])       ->   str:



						"""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}")
						_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}")





from typing import TYPE_CHECKING

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


UpperCAmelCase__       =	{
    "configuration_deberta": ["DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP", "DebertaConfig", "DebertaOnnxConfig"],
    "tokenization_deberta": ["DebertaTokenizer"],
}

try:
							if not is_tokenizers_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__       =	["DebertaTokenizerFast"]

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__       =	[
							    "DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "DebertaForMaskedLM",
							    "DebertaForQuestionAnswering",
							    "DebertaForSequenceClassification",
							    "DebertaForTokenClassification",
							    "DebertaModel",
							    "DebertaPreTrainedModel",
							]

try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__       =	[
							    "TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "TFDebertaForMaskedLM",
							    "TFDebertaForQuestionAnswering",
							    "TFDebertaForSequenceClassification",
							    "TFDebertaForTokenClassification",
							    "TFDebertaModel",
							    "TFDebertaPreTrainedModel",
							]


if TYPE_CHECKING:
							from .configuration_deberta import DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaConfig, DebertaOnnxConfig
							from .tokenization_deberta import DebertaTokenizer

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_deberta_fast import DebertaTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_deberta import (
														    DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
														    DebertaForMaskedLM,
														    DebertaForQuestionAnswering,
														    DebertaForSequenceClassification,
														    DebertaForTokenClassification,
														    DebertaModel,
														    DebertaPreTrainedModel,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_deberta import (
														    TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFDebertaForMaskedLM,
														    TFDebertaForQuestionAnswering,
														    TFDebertaForSequenceClassification,
														    TFDebertaForTokenClassification,
														    TFDebertaModel,
														    TFDebertaPreTrainedModel,
														)


else:
							import sys

							UpperCAmelCase__       =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
