



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



class 				__snake_case						(     UpperCamelCase_						):
							_a			      = ['''image_processor''', '''tokenizer''']
							_a			      = '''AutoImageProcessor'''
							_a			      = '''AutoTokenizer'''




							def __init__(       self     :       Tuple				,				A_     :       int				,				A_     :       int):
									super().__init__(A_				,				A_)
									lowerCAmelCase_			:     Optional[int]									= self.image_processor




							def __call__(       self     :       List[str]				,				A_     :       Tuple=None				,				A_     :       List[Any]=None				,				A_     :       Any=None				,				**A_     :       List[str]):

									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_			:     List[Any]									= self.tokenizer(A_				,				return_tensors=A_				,				**A_)

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

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




							def    UpperCAmelCase__			(       self     :       Tuple				,				*A_     :       Any				,				**A_     :       int):
									return self.tokenizer.batch_decode(*A_				,				**A_)




							def    UpperCAmelCase__			(       self     :       str				,				*A_     :       Optional[Any]				,				**A_     :       Optional[Any]):
									return self.tokenizer.decode(*A_				,				**A_)







							@property
							def    UpperCAmelCase__			(       self     :       int):
									return ["input_ids", "attention_mask", "pixel_values"]







# flake8: noqa
# Lint as: python3
A     :	Optional[Any]    = [
    'VerificationMode',
    'Version',
    'disable_progress_bar',
    'enable_progress_bar',
    'is_progress_bar_enabled',
    'experimental',
]

from .info_utils import VerificationMode
from .logging import disable_progress_bar, enable_progress_bar, is_progress_bar_enabled
from .version import Version
from .experimental import experimental