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






class 		a__						( A__ ):
					A     	=							['image_processor', 'tokenizer']
					A     	=							'EfficientNetImageProcessor'
					A     	=							('BertTokenizer', 'BertTokenizerFast')

					def __init__(   self				:	Any,_A				:	List[Any],_A				:	str   ):







							"""simple docstring"""






							super().__init__(_A,_A   )

					def __call__(   self				:	str,_A				:	str=None,_A				:	int=None,_A				:	Tuple="max_length",_A				:	Optional[Any]=64,_A				:	Optional[int]=None,**_A				:	Union[str, Any]   ):







							"""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_  :		List[str]    				=   self.tokenizer(
									    _A,padding=_A,max_length=_A,return_tensors=_A,**_A   )

							if images is not None:
									SCREAMING_SNAKE_CASE_  :		str    				=   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     __UpperCamelCase       (   self				:	Optional[int],*_A				:	int,**_A				:	List[Any]   ):







							"""simple docstring"""






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

					def     __UpperCamelCase       (   self				:	Dict,*_A				:	Dict,**_A				:	Optional[Any]   ):







							"""simple docstring"""






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






					@property
					def     __UpperCamelCase       (   self				:	Tuple   ):







							"""simple docstring"""






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

from ..utils import DummyObject, requires_backends






class 		a__						( metaclass=A__ ):
					A     	=							['tensorflow_text']

					def __init__(   self				:	List[str],*_A				:	Optional[Any],**_A				:	int   ):







							"""simple docstring"""






							requires_backends(self,["tensorflow_text"]   )
