






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


lowerCAmelCase__    						=			logging.get_logger(__name__)

lowerCAmelCase__    						=			{}


class _lowerCAmelCase						(    __UpperCAmelCase       ):
						SCREAMING_SNAKE_CASE_:					List[str] 					=				'llama'
						SCREAMING_SNAKE_CASE_:					int 					=				['past_key_values']







						def __init__(    self   ,				lowerCAmelCase_=3_2_0_0_0   ,				lowerCAmelCase_=4_0_9_6   ,				lowerCAmelCase_=1_1_0_0_8   ,				lowerCAmelCase_=3_2   ,				lowerCAmelCase_=3_2   ,				lowerCAmelCase_=None   ,				lowerCAmelCase_="silu"   ,				lowerCAmelCase_=2_0_4_8   ,				lowerCAmelCase_=0.02   ,				lowerCAmelCase_=1e-6   ,				lowerCAmelCase_=True   ,				lowerCAmelCase_=0   ,				lowerCAmelCase_=1   ,				lowerCAmelCase_=2   ,				lowerCAmelCase_=1   ,				lowerCAmelCase_=False   ,				lowerCAmelCase_=None   ,				**lowerCAmelCase_   ,				)		->							str:
										_SCREAMING_SNAKE_CASE   :		List[Any]       		=    vocab_size
										_SCREAMING_SNAKE_CASE   :		Tuple       		=    max_position_embeddings
										_SCREAMING_SNAKE_CASE   :		Tuple       		=    hidden_size
										_SCREAMING_SNAKE_CASE   :		Dict       		=    intermediate_size
										_SCREAMING_SNAKE_CASE   :		List[str]       		=    num_hidden_layers
										_SCREAMING_SNAKE_CASE   :		int       		=    num_attention_heads

										# for backward compatibility
										if num_key_value_heads is None:
														_SCREAMING_SNAKE_CASE   :		str       		=    num_attention_heads

										_SCREAMING_SNAKE_CASE   :		List[Any]       		=    num_key_value_heads
										_SCREAMING_SNAKE_CASE   :		Optional[Any]       		=    hidden_act
										_SCREAMING_SNAKE_CASE   :		int       		=    initializer_range
										_SCREAMING_SNAKE_CASE   :		Tuple       		=    rms_norm_eps
										_SCREAMING_SNAKE_CASE   :		str       		=    pretraining_tp
										_SCREAMING_SNAKE_CASE   :		List[Any]       		=    use_cache
										_SCREAMING_SNAKE_CASE   :		Union[str, Any]       		=    rope_scaling
										self._rope_scaling_validation()

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







						def 			A      (    self							)		->							Dict:
										if self.rope_scaling is None:
														return

										if not isinstance(self.rope_scaling   ,				lowerCAmelCase_							) 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}"""							)
										_SCREAMING_SNAKE_CASE   :		Any       		=    self.rope_scaling.get('type'   ,				lowerCAmelCase_							)
										_SCREAMING_SNAKE_CASE   :		Union[str, Any]       		=    self.rope_scaling.get('factor'   ,				lowerCAmelCase_							)
										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(lowerCAmelCase_   ,				lowerCAmelCase_							) 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"""
from ...utils import is_torch_available, is_transformers_available


if is_transformers_available() and is_torch_available():
			from .pipeline_vq_diffusion import LearnedClassifierFreeSamplingEmbeddings, VQDiffusionPipeline

