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


lowercase__							:							Tuple									=			logging.get_logger(__name__)

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






class        SCREAMING_SNAKE_CASE__    (							SCREAMING_SNAKE_CASE_    ):

							"""simple docstring"""






							_snake_case     		=  'open-llama'



							def __init__(  self     ,	SCREAMING_SNAKE_CASE_=100000     ,	SCREAMING_SNAKE_CASE_=4096     ,	SCREAMING_SNAKE_CASE_=11008     ,	SCREAMING_SNAKE_CASE_=32     ,	SCREAMING_SNAKE_CASE_=32     ,	SCREAMING_SNAKE_CASE_="silu"     ,	SCREAMING_SNAKE_CASE_=2048     ,	SCREAMING_SNAKE_CASE_=0.0_2     ,	SCREAMING_SNAKE_CASE_=1E-6     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=0     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=2     ,	SCREAMING_SNAKE_CASE_=False     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=0.1     ,	SCREAMING_SNAKE_CASE_=0.1     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=None     ,	**SCREAMING_SNAKE_CASE_     ,	)->   List[str]:





													'''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'''     ,	SCREAMING_SNAKE_CASE_			)
													__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=SCREAMING_SNAKE_CASE_     ,	bos_token_id=SCREAMING_SNAKE_CASE_     ,	eos_token_id=SCREAMING_SNAKE_CASE_     ,	tie_word_embeddings=SCREAMING_SNAKE_CASE_     ,	**SCREAMING_SNAKE_CASE_     ,	)



							def     A__		(  self			)->   str:





													'''simple docstring'''






													if self.rope_scaling is None:
																			return

													if not isinstance(self.rope_scaling     ,	SCREAMING_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}"			)
													__UpperCamelCase       =			self.rope_scaling.get('''type'''     ,	SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			self.rope_scaling.get('''factor'''     ,	SCREAMING_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(SCREAMING_SNAKE_CASE_     ,	SCREAMING_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_flax_available,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


lowercase__							:							Dict									=			{"configuration_vit": ["VIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTConfig", "ViTOnnxConfig"]}

try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase__							:							Tuple									=			["ViTFeatureExtractor"]
				lowercase__							:							str									=			["ViTImageProcessor"]

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase__							:							List[str]									=			[
				    "VIT_PRETRAINED_MODEL_ARCHIVE_LIST",
				    "ViTForImageClassification",
				    "ViTForMaskedImageModeling",
				    "ViTModel",
				    "ViTPreTrainedModel",
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase__							:							Tuple									=			[
				    "TFViTForImageClassification",
				    "TFViTModel",
				    "TFViTPreTrainedModel",
				]

try:
				if not is_flax_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase__							:							List[Any]									=			[
				    "FlaxViTForImageClassification",
				    "FlaxViTModel",
				    "FlaxViTPreTrainedModel",
				]

if TYPE_CHECKING:
				from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig, ViTOnnxConfig

				try:
								if not is_vision_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .feature_extraction_vit import ViTFeatureExtractor
								from .image_processing_vit import ViTImageProcessor

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_vit import (
								    VIT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    ViTForImageClassification,
								    ViTForMaskedImageModeling,
								    ViTModel,
								    ViTPreTrainedModel,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_vit import TFViTForImageClassification, TFViTModel, TFViTPreTrainedModel

				try:
								if not is_flax_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_flax_vit import FlaxViTForImageClassification, FlaxViTModel, FlaxViTPreTrainedModel


else:
				import sys

				lowercase__							:							List[Any]									=			_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




