"""simple docstring"""





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


lowerCAmelCase_     =	logging.get_logger(__name__)

lowerCAmelCase_     =	{
    '''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  _snake_case		(    __snake_case ):







				"""simple docstring"""






				a			=						"vit_mae"





				def __init__(      self							:							Union[str, Any]      ,    _A							:							List[Any]=7_6_8      ,    _A							:							Union[str, Any]=1_2      ,    _A							:							str=1_2      ,    _A							:							int=3_0_7_2      ,    _A							:							List[Any]="gelu"      ,    _A							:							Dict=0.0      ,    _A							:							int=0.0      ,    _A							:							Optional[int]=0.02      ,    _A							:							Union[str, Any]=1e-12      ,    _A							:							List[str]=2_2_4      ,    _A							:							Dict=1_6      ,    _A							:							Any=3      ,    _A							:							Optional[int]=True      ,    _A							:							List[Any]=1_6      ,    _A							:							Any=5_1_2      ,    _A							:							Any=8      ,    _A							:							int=2_0_4_8      ,    _A							:							Any=0.75      ,    _A							:							Tuple=False      ,    **_A							:							List[str]      ,    ):



											"""simple docstring"""







											super().__init__(**_A)

											_SCREAMING_SNAKE_CASE		:						int			  =    hidden_size
											_SCREAMING_SNAKE_CASE		:						str			  =    num_hidden_layers
											_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    num_attention_heads
											_SCREAMING_SNAKE_CASE		:						Optional[int]			  =    intermediate_size
											_SCREAMING_SNAKE_CASE		:						List[str]			  =    hidden_act
											_SCREAMING_SNAKE_CASE		:						Dict			  =    hidden_dropout_prob
											_SCREAMING_SNAKE_CASE		:						Tuple			  =    attention_probs_dropout_prob
											_SCREAMING_SNAKE_CASE		:						List[Any]			  =    initializer_range
											_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    layer_norm_eps
											_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    image_size
											_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    patch_size
											_SCREAMING_SNAKE_CASE		:						Any			  =    num_channels
											_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    qkv_bias
											_SCREAMING_SNAKE_CASE		:						Optional[int]			  =    decoder_num_attention_heads
											_SCREAMING_SNAKE_CASE		:						List[str]			  =    decoder_hidden_size
											_SCREAMING_SNAKE_CASE		:						List[str]			  =    decoder_num_hidden_layers
											_SCREAMING_SNAKE_CASE		:						Any			  =    decoder_intermediate_size
											_SCREAMING_SNAKE_CASE		:						int			  =    mask_ratio
											_SCREAMING_SNAKE_CASE		:						List[Any]			  =    norm_pix_loss



"""simple docstring"""





import warnings

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




class  _snake_case		(    __snake_case ):







				"""simple docstring"""






				a			=						["image_processor", "tokenizer"]
				a			=						"ChineseCLIPImageProcessor"
				a			=						("BertTokenizer", "BertTokenizerFast")





				def __init__(      self							:							Dict      ,    _A							:							Tuple=None      ,    _A							:							List[Any]=None      ,    **_A							:							int):



											"""simple docstring"""







											_SCREAMING_SNAKE_CASE		:						Tuple			  =    None
											if "feature_extractor" in kwargs:
																		warnings.warn(
																		    """The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"""
																		    """ instead."""      ,    _A      ,    )
																		_SCREAMING_SNAKE_CASE		:						str			  =    kwargs.pop("""feature_extractor""")

											_SCREAMING_SNAKE_CASE		:						int			  =    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__(_A      ,    _A)
											_SCREAMING_SNAKE_CASE		:						Dict			  =    self.image_processor





				def __call__(      self							:							Optional[int]      ,    _A							:							Optional[Any]=None      ,    _A							:							Any=None      ,    _A							:							Tuple=None      ,    **_A							:							int):



											"""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:
																		_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    self.tokenizer(_A      ,    return_tensors=_A      ,    **_A)

											if images is not None:
																		_SCREAMING_SNAKE_CASE		:						List[Any]			  =    self.image_processor(_A      ,    return_tensors=_A      ,    **_A)

											if text is not None and images is not None:
																		_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    image_features.pixel_values
																		return encoding
											elif text is not None:
																		return encoding
											else:
																		return BatchEncoding(data=dict(**_A)      ,    tensor_type=_A)





				def 		_lowerCAmelCase		(      self							:							str      ,    *_A							:							Any      ,    **_A							:							Any):



											"""simple docstring"""







											return self.tokenizer.batch_decode(*_A      ,    **_A)





				def 		_lowerCAmelCase		(      self							:							Union[str, Any]      ,    *_A							:							List[Any]      ,    **_A							:							Any):



											"""simple docstring"""







											return self.tokenizer.decode(*_A      ,    **_A)





				@property
				def 		_lowerCAmelCase		(      self							:							str):



											"""simple docstring"""







											_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    self.tokenizer.model_input_names
											_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    self.image_processor.model_input_names
											return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))





				@property
				def 		_lowerCAmelCase		(      self							:							List[str]):



											"""simple docstring"""







											warnings.warn(
											    """`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead."""      ,    _A      ,    )
											return self.image_processor_class


