




"""simple docstring"""





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

class    __lowercase							(      snake_case_						):


				'''simple docstring'''


				_lowerCAmelCase						      =["image_processor", "tokenizer"]
				_lowerCAmelCase						      ="EfficientNetImageProcessor"
				_lowerCAmelCase						      =("BertTokenizer", "BertTokenizerFast")

				def __init__( self :  Optional[Any]   ,SCREAMING_SNAKE_CASE_ :  Any   ,SCREAMING_SNAKE_CASE_ :  int   ):
										super().__init__(SCREAMING_SNAKE_CASE_   ,SCREAMING_SNAKE_CASE_   )

				def __call__( self :  Tuple   ,SCREAMING_SNAKE_CASE_ :  List[Any]=None   ,SCREAMING_SNAKE_CASE_ :  Union[str, Any]=None   ,SCREAMING_SNAKE_CASE_ :  str="max_length"   ,SCREAMING_SNAKE_CASE_ :  Tuple=6_4   ,SCREAMING_SNAKE_CASE_ :  Optional[int]=None   ,**SCREAMING_SNAKE_CASE_ :  Optional[Any]   ):
										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:
																snake_case__							:       int				      =       self.tokenizer(
																    SCREAMING_SNAKE_CASE_   ,padding=SCREAMING_SNAKE_CASE_   ,max_length=SCREAMING_SNAKE_CASE_   ,return_tensors=SCREAMING_SNAKE_CASE_   ,**SCREAMING_SNAKE_CASE_   )

										if images is not None:
																snake_case__							:       Any				      =       self.image_processor(SCREAMING_SNAKE_CASE_   ,return_tensors=SCREAMING_SNAKE_CASE_   ,**SCREAMING_SNAKE_CASE_   )

										if text is not None and images is not None:
																snake_case__							:       List[str]				      =       image_features.pixel_values
																return encoding
										elif text is not None:
																return encoding
										else:
																return BatchEncoding(data=dict(**SCREAMING_SNAKE_CASE_   )   ,tensor_type=SCREAMING_SNAKE_CASE_   )

				def    _lowerCamelCase       ( self :  str   ,*SCREAMING_SNAKE_CASE_ :  List[str]   ,**SCREAMING_SNAKE_CASE_ :  Union[str, Any]   ):
										return self.tokenizer.batch_decode(*SCREAMING_SNAKE_CASE_   ,**SCREAMING_SNAKE_CASE_   )

				def    _lowerCamelCase       ( self :  Optional[int]   ,*SCREAMING_SNAKE_CASE_ :  str   ,**SCREAMING_SNAKE_CASE_ :  Dict   ):
										return self.tokenizer.decode(*SCREAMING_SNAKE_CASE_   ,**SCREAMING_SNAKE_CASE_   )





				@property
				def    _lowerCamelCase       ( self :  List[Any]   ):
										snake_case__							:       List[str]				      =       self.tokenizer.model_input_names
										snake_case__							:       Union[str, Any]				      =       self.image_processor.model_input_names
										return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names   )   )








"""simple docstring"""





_lowercase						   =     [0.4_85, 0.4_56, 0.4_06]
_lowercase						   =     [0.2_29, 0.2_24, 0.2_25]
_lowercase						   =     [0.5, 0.5, 0.5]
_lowercase						   =     [0.5, 0.5, 0.5]
_lowercase						   =     [0.48_14_54_66, 0.4_57_82_75, 0.40_82_10_73]
_lowercase						   =     [0.26_86_29_54, 0.26_13_02_58, 0.27_57_77_11]


