





'''simple docstring'''




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


lowercase__   :				Dict      =   logging.get_logger(__name__)

lowercase__   :				int      =   {}


class 			SCREAMING_SNAKE_CASE   (a__							):
     lowerCAmelCase		      =	'''llama'''
     lowerCAmelCase		      =	['''past_key_values''']


     def __init__(						self						,     _UpperCAmelCase=3_2000						,     _UpperCAmelCase=4096						,     _UpperCAmelCase=1_1008						,     _UpperCAmelCase=32						,     _UpperCAmelCase=32						,     _UpperCAmelCase=None						,     _UpperCAmelCase="silu"						,     _UpperCAmelCase=2048						,     _UpperCAmelCase=0.02						,     _UpperCAmelCase=1e-6						,     _UpperCAmelCase=True						,     _UpperCAmelCase=0						,     _UpperCAmelCase=1						,     _UpperCAmelCase=2						,     _UpperCAmelCase=1						,     _UpperCAmelCase=False						,     _UpperCAmelCase=None						,     **_UpperCAmelCase						,     ):

          '''simple docstring'''






          __A						:			Optional[Any]								=	vocab_size
          __A						:			Optional[int]								=	max_position_embeddings
          __A						:			Tuple								=	hidden_size
          __A						:			List[str]								=	intermediate_size
          __A						:			List[str]								=	num_hidden_layers
          __A						:			Optional[Any]								=	num_attention_heads

          # for backward compatibility
          if num_key_value_heads is None:
               __A						:			Union[str, Any]								=	num_attention_heads

          __A						:			Any								=	num_key_value_heads
          __A						:			Any								=	hidden_act
          __A						:			Optional[Any]								=	initializer_range
          __A						:			Dict								=	rms_norm_eps
          __A						:			Optional[int]								=	pretraining_tp
          __A						:			str								=	use_cache
          __A						:			int								=	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}')
          __A						:			str								=	self.rope_scaling.get('type'						,     _UpperCAmelCase)
          __A						:			Union[str, Any]								=	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}')






'''simple docstring'''




from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
  if not (is_transformers_available() and is_torch_available()):
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  from ...utils.dummy_torch_and_transformers_objects import ShapEPipeline
else:
  from .camera import create_pan_cameras
  from .pipeline_shap_e import ShapEPipeline
  from .pipeline_shap_e_img2img import ShapEImgaImgPipeline
  from .renderer import (
      BoundingBoxVolume,
      ImportanceRaySampler,
      MLPNeRFModelOutput,
      MLPNeRSTFModel,
      ShapEParamsProjModel,
      ShapERenderer,
      StratifiedRaySampler,
      VoidNeRFModel,
  )