






from typing import TYPE_CHECKING

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


_UpperCamelCase			:	Optional[int]								={
    'configuration_convnext': ['CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ConvNextConfig', 'ConvNextOnnxConfig']
}

try:
	if not is_vision_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCamelCase			:	Optional[Any]								=['ConvNextFeatureExtractor']
	_UpperCamelCase			:	int								=['ConvNextImageProcessor']

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCamelCase			:	str								=[
	    'CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'ConvNextForImageClassification',
	    'ConvNextModel',
	    'ConvNextPreTrainedModel',
	    'ConvNextBackbone',
	]

try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCamelCase			:	Any								=[
	    'TFConvNextForImageClassification',
	    'TFConvNextModel',
	    'TFConvNextPreTrainedModel',
	]

if TYPE_CHECKING:
	from .configuration_convnext import CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvNextConfig, ConvNextOnnxConfig

	try:
		if not is_vision_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .feature_extraction_convnext import ConvNextFeatureExtractor
		from .image_processing_convnext import ConvNextImageProcessor

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_convnext import (
		    CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    ConvNextBackbone,
		    ConvNextForImageClassification,
		    ConvNextModel,
		    ConvNextPreTrainedModel,
		)

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_convnext import TFConvNextForImageClassification, TFConvNextModel, TFConvNextPreTrainedModel


else:
	import sys

	_UpperCamelCase			:	Tuple								=_LazyModule(__name__, globals()['__file__'], _import_structure)











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


_UpperCamelCase			:	List[Any]								=logging.get_logger(__name__)

_UpperCamelCase			:	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 						UpperCAmelCase__ (							__snake_case							):
		__snake_case      :       Optional[int]     =   "pegasus"
		__snake_case      :       List[str]     =   ["past_key_values"]
		__snake_case      :       Union[str, Any]     =   {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}







		def __init__(					self       ,A__=50265       ,A__=1024       ,A__=12       ,A__=4096       ,A__=16       ,A__=12       ,A__=4096       ,A__=16       ,A__=0.0       ,A__=0.0       ,A__=True       ,A__=True       ,A__="gelu"       ,A__=1024       ,A__=0.1       ,A__=0.0       ,A__=0.0       ,A__=0.02       ,A__=0       ,A__=False       ,A__=0       ,A__=1       ,A__=1       ,**A__       ,):
						_A	:				List[str]   =      vocab_size
						_A	:				List[Any]   =      max_position_embeddings
						_A	:				Union[str, Any]   =      d_model
						_A	:				Union[str, Any]   =      encoder_ffn_dim
						_A	:				Union[str, Any]   =      encoder_layers
						_A	:				int   =      encoder_attention_heads
						_A	:				List[Any]   =      decoder_ffn_dim
						_A	:				Optional[int]   =      decoder_layers
						_A	:				Tuple   =      decoder_attention_heads
						_A	:				List[str]   =      dropout
						_A	:				Tuple   =      attention_dropout
						_A	:				Union[str, Any]   =      activation_dropout
						_A	:				int   =      activation_function
						_A	:				Union[str, Any]   =      init_std
						_A	:				Any   =      encoder_layerdrop
						_A	:				int   =      decoder_layerdrop
						_A	:				Tuple   =      use_cache
						_A	:				Dict   =      encoder_layers
						_A	:				List[str]   =      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  A__      (					self		):
						return self.encoder_attention_heads







		@property
		def  A__      (					self		):
						return self.d_model



