




import warnings

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding







class        __lowerCAmelCase					(			__magic_name__					):

			"""simple docstring"""







			snake_case_  						=			['''image_processor''', '''tokenizer''']
			snake_case_  						=			'''ChineseCLIPImageProcessor'''
			snake_case_  						=			('''BertTokenizer''', '''BertTokenizerFast''')


			def __init__( self     ,		lowerCamelCase__=None     ,		lowerCamelCase__=None     ,		**lowerCamelCase__				)       -> str:



							'''simple docstring'''
							__lowerCamelCase									=       None
							if "feature_extractor" in kwargs:
											warnings.warn(
											    'The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'
											    ' instead.'     ,		lowerCamelCase__     ,		)
											__lowerCamelCase									=       kwargs.pop('feature_extractor'				)

							__lowerCamelCase									=       image_processor if image_processor is not None else feature_extractor
							if image_processor is None:
											raise ValueError('You need to specify an `image_processor`.'				)
							if tokenizer is None:
											raise ValueError('You need to specify a `tokenizer`.'				)

							super().__init__(lowerCamelCase__     ,		lowerCamelCase__				)
							__lowerCamelCase									=       self.image_processor


			def __call__( self     ,		lowerCamelCase__=None     ,		lowerCamelCase__=None     ,		lowerCamelCase__=None     ,		**lowerCamelCase__				)       -> Dict:



							'''simple docstring'''

							if text is None and images is None:
											raise ValueError('You have to specify either text or images. Both cannot be none.'				)

							if text is not None:
											__lowerCamelCase									=       self.tokenizer(lowerCamelCase__     ,		return_tensors=lowerCamelCase__     ,		**lowerCamelCase__				)

							if images is not None:
											__lowerCamelCase									=       self.image_processor(lowerCamelCase__     ,		return_tensors=lowerCamelCase__     ,		**lowerCamelCase__				)

							if text is not None and images is not None:
											__lowerCamelCase									=       image_features.pixel_values
											return encoding
							elif text is not None:
											return encoding
							else:
											return BatchEncoding(data=dict(**lowerCamelCase__				)     ,		tensor_type=lowerCamelCase__				)


			def  lowercase_       ( self     ,		*lowerCamelCase__     ,		**lowerCamelCase__				)       -> Tuple:



							'''simple docstring'''
							return self.tokenizer.batch_decode(*lowerCamelCase__     ,		**lowerCamelCase__				)


			def  lowercase_       ( self     ,		*lowerCamelCase__     ,		**lowerCamelCase__				)       -> List[str]:



							'''simple docstring'''
							return self.tokenizer.decode(*lowerCamelCase__     ,		**lowerCamelCase__				)


			@property
			def  lowercase_       ( self				)       -> Tuple:



							'''simple docstring'''
							__lowerCamelCase									=       self.tokenizer.model_input_names
							__lowerCamelCase									=       self.image_processor.model_input_names
							return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names				)				)






			@property
			def  lowercase_       ( self				)       -> List[str]:



							'''simple docstring'''
							warnings.warn(
							    '`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'     ,		lowerCamelCase__     ,		)
							return self.image_processor_class








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


__A								=       logging.get_logger(__name__)

__A								=       {
    "facebook/vit-mae-base": "https://huggingface.co/facebook/vit-mae-base/resolve/main/config.json",
    # See all ViT MAE models at https://huggingface.co/models?filter=vit-mae
}







class        __lowerCAmelCase					(			__magic_name__					):

			"""simple docstring"""







			snake_case_  						=			'''vit_mae'''


			def __init__( self     ,		lowerCamelCase__=768     ,		lowerCamelCase__=12     ,		lowerCamelCase__=12     ,		lowerCamelCase__=3_072     ,		lowerCamelCase__="gelu"     ,		lowerCamelCase__=0.0     ,		lowerCamelCase__=0.0     ,		lowerCamelCase__=0.02     ,		lowerCamelCase__=1e-12     ,		lowerCamelCase__=224     ,		lowerCamelCase__=16     ,		lowerCamelCase__=3     ,		lowerCamelCase__=True     ,		lowerCamelCase__=16     ,		lowerCamelCase__=512     ,		lowerCamelCase__=8     ,		lowerCamelCase__=2_048     ,		lowerCamelCase__=0.75     ,		lowerCamelCase__=False     ,		**lowerCamelCase__     ,		)       -> Optional[int]:



							'''simple docstring'''
							super().__init__(**lowerCamelCase__				)

							__lowerCamelCase									=       hidden_size
							__lowerCamelCase									=       num_hidden_layers
							__lowerCamelCase									=       num_attention_heads
							__lowerCamelCase									=       intermediate_size
							__lowerCamelCase									=       hidden_act
							__lowerCamelCase									=       hidden_dropout_prob
							__lowerCamelCase									=       attention_probs_dropout_prob
							__lowerCamelCase									=       initializer_range
							__lowerCamelCase									=       layer_norm_eps
							__lowerCamelCase									=       image_size
							__lowerCamelCase									=       patch_size
							__lowerCamelCase									=       num_channels
							__lowerCamelCase									=       qkv_bias
							__lowerCamelCase									=       decoder_num_attention_heads
							__lowerCamelCase									=       decoder_hidden_size
							__lowerCamelCase									=       decoder_num_hidden_layers
							__lowerCamelCase									=       decoder_intermediate_size
							__lowerCamelCase									=       mask_ratio
							__lowerCamelCase									=       norm_pix_loss


