from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__SCREAMING_SNAKE_CASE						:   Tuple         =			{
    'configuration_chinese_clip': [
        'CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'ChineseCLIPConfig',
        'ChineseCLIPOnnxConfig',
        'ChineseCLIPTextConfig',
        'ChineseCLIPVisionConfig',
    ],
    'processing_chinese_clip': ['ChineseCLIPProcessor'],
}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__SCREAMING_SNAKE_CASE						:   Any         =			['ChineseCLIPFeatureExtractor']
		__SCREAMING_SNAKE_CASE						:   Any         =			['ChineseCLIPImageProcessor']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__SCREAMING_SNAKE_CASE						:   int         =			[
		    'CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'ChineseCLIPModel',
		    'ChineseCLIPPreTrainedModel',
		    'ChineseCLIPTextModel',
		    'ChineseCLIPVisionModel',
		]

if TYPE_CHECKING:
		from .configuration_chinese_clip import (
		    CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    ChineseCLIPConfig,
		    ChineseCLIPOnnxConfig,
		    ChineseCLIPTextConfig,
		    ChineseCLIPVisionConfig,
		)
		from .processing_chinese_clip import ChineseCLIPProcessor

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_chinese_clip import ChineseCLIPFeatureExtractor, ChineseCLIPImageProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_chinese_clip import (
				    CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
				    ChineseCLIPModel,
				    ChineseCLIPPreTrainedModel,
				    ChineseCLIPTextModel,
				    ChineseCLIPVisionModel,
				)

else:
		import sys

		__SCREAMING_SNAKE_CASE						:   int         =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
import logging

from transformers import PretrainedConfig


__SCREAMING_SNAKE_CASE						:   Any         =			logging.getLogger(__name__)


__SCREAMING_SNAKE_CASE						:   int         =			{
    'bertabs-finetuned-cnndm': 'https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json',
}



class        lowercase_   (					__snake_case		):
							_lowerCamelCase						=		'bertabs'



							def __init__(						self				,    lowercase_=30_522				,    lowercase_=512				,    lowercase_=6				,    lowercase_=512				,    lowercase_=8				,    lowercase_=512				,    lowercase_=0.2				,    lowercase_=6				,    lowercase_=768				,    lowercase_=8				,    lowercase_=2_048				,    lowercase_=0.2				,    **lowercase_				,    ):
													super().__init__(**lowercase_    )

													_snake_case						:					List[Any]    =   vocab_size
													_snake_case						:					int    =   max_pos

													_snake_case						:					Tuple    =   enc_layers
													_snake_case						:					Optional[Any]    =   enc_hidden_size
													_snake_case						:					Union[str, Any]    =   enc_heads
													_snake_case						:					str    =   enc_ff_size
													_snake_case						:					Any    =   enc_dropout

													_snake_case						:					Tuple    =   dec_layers
													_snake_case						:					Optional[Any]    =   dec_hidden_size
													_snake_case						:					Dict    =   dec_heads
													_snake_case						:					str    =   dec_ff_size
													_snake_case						:					List[str]    =   dec_dropout