





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


SCREAMING_SNAKE_CASE_   :      Union[str, Any]			=   {'''configuration_vit''': ['''VIT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ViTConfig''', '''ViTOnnxConfig''']}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		SCREAMING_SNAKE_CASE_   :      List[str]			=   ['''ViTFeatureExtractor''']
		SCREAMING_SNAKE_CASE_   :      Optional[int]			=   ['''ViTImageProcessor''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		SCREAMING_SNAKE_CASE_   :      int			=   [
		    '''VIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''ViTForImageClassification''',
		    '''ViTForMaskedImageModeling''',
		    '''ViTModel''',
		    '''ViTPreTrainedModel''',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		SCREAMING_SNAKE_CASE_   :      Optional[int]			=   [
		    '''TFViTForImageClassification''',
		    '''TFViTModel''',
		    '''TFViTPreTrainedModel''',
		]

try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		SCREAMING_SNAKE_CASE_   :      List[str]			=   [
		    '''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

		SCREAMING_SNAKE_CASE_   :      Optional[Any]			=   _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)











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


SCREAMING_SNAKE_CASE_   :      Dict			=   logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_   :      Union[str, Any]			=   {
    '''RWKV/rwkv-4-169m-pile''': '''https://huggingface.co/RWKV/rwkv-4-169m-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-430m-pile''': '''https://huggingface.co/RWKV/rwkv-4-430m-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-1b5-pile''': '''https://huggingface.co/RWKV/rwkv-4-1b5-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-3b-pile''': '''https://huggingface.co/RWKV/rwkv-4-3b-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-7b-pile''': '''https://huggingface.co/RWKV/rwkv-4-7b-pile/resolve/main/config.json''',
    '''RWKV/rwkv-4-14b-pile''': '''https://huggingface.co/RWKV/rwkv-4-14b-pile/resolve/main/config.json''',
    '''RWKV/rwkv-raven-1b5''': '''https://huggingface.co/RWKV/rwkv-raven-1b5/resolve/main/config.json''',
    '''RWKV/rwkv-raven-3b''': '''https://huggingface.co/RWKV/rwkv-raven-3b/resolve/main/config.json''',
    '''RWKV/rwkv-raven-7b''': '''https://huggingface.co/RWKV/rwkv-raven-7b/resolve/main/config.json''',
    '''RWKV/rwkv-raven-14b''': '''https://huggingface.co/RWKV/rwkv-raven-14b/resolve/main/config.json''',
}

class 		snake_case_   (							UpperCAmelCase_						):







	'''simple docstring'''
	__UpperCamelCase   =		'''rwkv'''
	__UpperCamelCase   =		{'''max_position_embeddings''': '''context_length'''}




	def __init__(						self							:     List[str]					,      __lowerCamelCase							:     Tuple=50_277					,      __lowerCamelCase							:     List[str]=1_024					,      __lowerCamelCase							:     List[Any]=4_096					,      __lowerCamelCase							:     Tuple=32					,      __lowerCamelCase							:     List[str]=None					,      __lowerCamelCase							:     Optional[int]=None					,      __lowerCamelCase							:     Optional[Any]=1E-5					,      __lowerCamelCase							:     Tuple=0					,      __lowerCamelCase							:     int=0					,      __lowerCamelCase							:     Dict=6					,      __lowerCamelCase							:     List[Any]=False					,      __lowerCamelCase							:     Tuple=True					,      **__lowerCamelCase							:     Optional[int]					,      )       -> List[Any]:

			'''simple docstring'''




			__lowercase											=     vocab_size
			__lowercase											=     context_length
			__lowercase											=     hidden_size
			__lowercase											=     num_hidden_layers
			__lowercase											=     attention_hidden_size if attention_hidden_size is not None else hidden_size
			__lowercase											=     intermediate_size if intermediate_size is not None else 4 * hidden_size
			__lowercase											=     layer_norm_epsilon
			__lowercase											=     rescale_every
			__lowercase											=     use_cache

			__lowercase											=     bos_token_id
			__lowercase											=     eos_token_id

			super().__init__(
			    tie_word_embeddings=__lowerCamelCase					,      bos_token_id=__lowerCamelCase					,      eos_token_id=__lowerCamelCase					,      **__lowerCamelCase   )




