


from typing import TYPE_CHECKING

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


A_     :       Optional[int]   							={"""configuration_vit""": ["""VIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ViTConfig""", """ViTOnnxConfig"""]}

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

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

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

try:
	if not is_flax_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A_     :       Tuple   							=[
	    """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

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





'''simple docstring'''







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


lowercase      :   Optional[int]      =       logging.get_logger(__name__)

lowercase      :   Optional[Any]      =       {
    """google/pegasus-large""": """https://huggingface.co/google/pegasus-large/resolve/main/config.json""",
    # See all PEGASUS models at https://huggingface.co/models?filter=pegasus
}







class 					_a (a__	):





     '''simple docstring'''



     lowerCAmelCase_  :     Any          =					"""pegasus"""
     lowerCAmelCase_  :     Dict          =					["""past_key_values"""]
     lowerCAmelCase_  :     str          =					{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}







     def __init__(				self							,__a=50_265							,__a=1_024							,__a=12							,__a=4_096							,__a=16							,__a=12							,__a=4_096							,__a=16							,__a=0.0							,__a=0.0							,__a=True							,__a=True							,__a="gelu"							,__a=1_024							,__a=0.1							,__a=0.0							,__a=0.0							,__a=0.02							,__a=0							,__a=False							,__a=0							,__a=1							,__a=1							,**__a							,)      ->				int:
          snake_case			:      List[Any]        =			vocab_size
          snake_case			:      Optional[Any]        =			max_position_embeddings
          snake_case			:      List[Any]        =			d_model
          snake_case			:      str        =			encoder_ffn_dim
          snake_case			:      List[Any]        =			encoder_layers
          snake_case			:      Optional[Any]        =			encoder_attention_heads
          snake_case			:      Union[str, Any]        =			decoder_ffn_dim
          snake_case			:      Tuple        =			decoder_layers
          snake_case			:      Union[str, Any]        =			decoder_attention_heads
          snake_case			:      Union[str, Any]        =			dropout
          snake_case			:      int        =			attention_dropout
          snake_case			:      int        =			activation_dropout
          snake_case			:      Optional[Any]        =			activation_function
          snake_case			:      Tuple        =			init_std
          snake_case			:      Union[str, Any]        =			encoder_layerdrop
          snake_case			:      int        =			decoder_layerdrop
          snake_case			:      Dict        =			use_cache
          snake_case			:      Dict        =			encoder_layers
          snake_case			:      List[Any]        =			scale_embedding  # scale factor will be sqrt(d_model) if True
          super().__init__(
              pad_token_id=__a							,eos_token_id=__a							,is_encoder_decoder=__a							,decoder_start_token_id=__a							,forced_eos_token_id=__a							,**__a							,)







     @property
     def 			snake_case_      (				self							)      ->				int:
          return self.encoder_attention_heads







     @property
     def 			snake_case_      (				self							)      ->				int:
          return self.d_model



