






'''simple docstring'''







import os
from typing import List, Optional, Union

from ...image_processing_utils import BatchFeature
from ...image_utils import ImageInput
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType
from ..auto import AutoTokenizer





class 	SCREAMING_SNAKE_CASE					(					SCREAMING_SNAKE_CASE_       ):
			snake_case__  =				["image_processor", "tokenizer"]
			snake_case__  =				"BlipImageProcessor"
			snake_case__  =				"AutoTokenizer"






			def __init__( self      :			Optional[Any]  ,						__SCREAMING_SNAKE_CASE      :			int  ,						__SCREAMING_SNAKE_CASE      :			Union[str, Any]  ,						__SCREAMING_SNAKE_CASE      :			Tuple					)			->			List[str]:
							super().__init__(__SCREAMING_SNAKE_CASE  ,						__SCREAMING_SNAKE_CASE					)

							# add QFormer tokenizer
							a_		:  Dict											=      qformer_tokenizer






			def __call__( self      :			Optional[int]  ,						__SCREAMING_SNAKE_CASE      :			ImageInput = None  ,						__SCREAMING_SNAKE_CASE      :			Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]] = None  ,						__SCREAMING_SNAKE_CASE      :			bool = True  ,						__SCREAMING_SNAKE_CASE      :			Union[bool, str, PaddingStrategy] = False  ,						__SCREAMING_SNAKE_CASE      :			Union[bool, str, TruncationStrategy] = None  ,						__SCREAMING_SNAKE_CASE      :			Optional[int] = None  ,						__SCREAMING_SNAKE_CASE      :			int = 0  ,						__SCREAMING_SNAKE_CASE      :			Optional[int] = None  ,						__SCREAMING_SNAKE_CASE      :			Optional[bool] = None  ,						__SCREAMING_SNAKE_CASE      :			bool = False  ,						__SCREAMING_SNAKE_CASE      :			bool = False  ,						__SCREAMING_SNAKE_CASE      :			bool = False  ,						__SCREAMING_SNAKE_CASE      :			bool = False  ,						__SCREAMING_SNAKE_CASE      :			bool = False  ,						__SCREAMING_SNAKE_CASE      :			bool = True  ,						__SCREAMING_SNAKE_CASE      :			Optional[Union[str, TensorType]] = None  ,						**__SCREAMING_SNAKE_CASE      :			str  ,						)			->			BatchFeature:
							if images is None and text is None:
											raise ValueError('''You have to specify at least images or text.'''					)

							a_		:  List[str]											=      BatchFeature()

							if text is not None:
											a_		:  str											=      self.tokenizer(
											    text=__SCREAMING_SNAKE_CASE  ,						add_special_tokens=__SCREAMING_SNAKE_CASE  ,						padding=__SCREAMING_SNAKE_CASE  ,						truncation=__SCREAMING_SNAKE_CASE  ,						max_length=__SCREAMING_SNAKE_CASE  ,						stride=__SCREAMING_SNAKE_CASE  ,						pad_to_multiple_of=__SCREAMING_SNAKE_CASE  ,						return_attention_mask=__SCREAMING_SNAKE_CASE  ,						return_overflowing_tokens=__SCREAMING_SNAKE_CASE  ,						return_special_tokens_mask=__SCREAMING_SNAKE_CASE  ,						return_offsets_mapping=__SCREAMING_SNAKE_CASE  ,						return_token_type_ids=__SCREAMING_SNAKE_CASE  ,						return_length=__SCREAMING_SNAKE_CASE  ,						verbose=__SCREAMING_SNAKE_CASE  ,						return_tensors=__SCREAMING_SNAKE_CASE  ,						**__SCREAMING_SNAKE_CASE  ,						)
											encoding.update(__SCREAMING_SNAKE_CASE					)
											a_		:  Any											=      self.qformer_tokenizer(
											    text=__SCREAMING_SNAKE_CASE  ,						add_special_tokens=__SCREAMING_SNAKE_CASE  ,						padding=__SCREAMING_SNAKE_CASE  ,						truncation=__SCREAMING_SNAKE_CASE  ,						max_length=__SCREAMING_SNAKE_CASE  ,						stride=__SCREAMING_SNAKE_CASE  ,						pad_to_multiple_of=__SCREAMING_SNAKE_CASE  ,						return_attention_mask=__SCREAMING_SNAKE_CASE  ,						return_overflowing_tokens=__SCREAMING_SNAKE_CASE  ,						return_special_tokens_mask=__SCREAMING_SNAKE_CASE  ,						return_offsets_mapping=__SCREAMING_SNAKE_CASE  ,						return_token_type_ids=__SCREAMING_SNAKE_CASE  ,						return_length=__SCREAMING_SNAKE_CASE  ,						verbose=__SCREAMING_SNAKE_CASE  ,						return_tensors=__SCREAMING_SNAKE_CASE  ,						**__SCREAMING_SNAKE_CASE  ,						)
											a_		:  str											=      qformer_text_encoding.pop('''input_ids'''					)
											a_		:  str											=      qformer_text_encoding.pop('''attention_mask'''					)

							if images is not None:
											a_		:  List[str]											=      self.image_processor(__SCREAMING_SNAKE_CASE  ,						return_tensors=__SCREAMING_SNAKE_CASE					)
											encoding.update(__SCREAMING_SNAKE_CASE					)

							return encoding






			def 			SCREAMING_SNAKE_CASE      ( self      :			Any  ,						*__SCREAMING_SNAKE_CASE      :			Any  ,						**__SCREAMING_SNAKE_CASE      :			List[str]					)			->			Optional[int]:
							return self.tokenizer.batch_decode(*__SCREAMING_SNAKE_CASE  ,						**__SCREAMING_SNAKE_CASE					)






			def 			SCREAMING_SNAKE_CASE      ( self      :			str  ,						*__SCREAMING_SNAKE_CASE      :			int  ,						**__SCREAMING_SNAKE_CASE      :			Optional[Any]					)			->			str:
							return self.tokenizer.decode(*__SCREAMING_SNAKE_CASE  ,						**__SCREAMING_SNAKE_CASE					)






			@property
			# Copied from transformers.models.blip.processing_blip.BlipProcessor.model_input_names
			def 			SCREAMING_SNAKE_CASE      ( self      :			int					)			->			List[Any]:
							a_		:  Any											=      self.tokenizer.model_input_names
							a_		:  Union[str, Any]											=      self.image_processor.model_input_names
							return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names					)					)






			def 			SCREAMING_SNAKE_CASE      ( self      :			Tuple  ,						__SCREAMING_SNAKE_CASE      :			Optional[Any]  ,						**__SCREAMING_SNAKE_CASE      :			Any					)			->			Dict:
							if os.path.isfile(__SCREAMING_SNAKE_CASE					):
											raise ValueError(f'Provided path ({save_directory}) should be a directory, not a file'					)
							os.makedirs(__SCREAMING_SNAKE_CASE  ,						exist_ok=__SCREAMING_SNAKE_CASE					)
							a_		:  Tuple											=      os.path.join(__SCREAMING_SNAKE_CASE  ,						'''qformer_tokenizer'''					)
							self.qformer_tokenizer.save_pretrained(__SCREAMING_SNAKE_CASE					)
							return super().save_pretrained(__SCREAMING_SNAKE_CASE  ,						**__SCREAMING_SNAKE_CASE					)







			@classmethod
			def 			SCREAMING_SNAKE_CASE      ( cls      :			str  ,						__SCREAMING_SNAKE_CASE      :			Any  ,						**__SCREAMING_SNAKE_CASE      :			List[str]					)			->			List[Any]:
							a_		:  Any											=      AutoTokenizer.from_pretrained(__SCREAMING_SNAKE_CASE  ,						subfolder='''qformer_tokenizer'''					)
							a_		:  List[Any]											=      cls._get_arguments_from_pretrained(__SCREAMING_SNAKE_CASE  ,						**__SCREAMING_SNAKE_CASE					)
							args.append(__SCREAMING_SNAKE_CASE					)
							return cls(*__SCREAMING_SNAKE_CASE					)












'''simple docstring'''







import sys

__lowerCAmelCase       		=      (
    '73167176531330624919225119674426574742355349194934'
    '96983520312774506326239578318016984801869478851843'
    '85861560789112949495459501737958331952853208805511'
    '12540698747158523863050715693290963295227443043557'
    '66896648950445244523161731856403098711121722383113'
    '62229893423380308135336276614282806444486645238749'
    '30358907296290491560440772390713810515859307960866'
    '70172427121883998797908792274921901699720888093776'
    '65727333001053367881220235421809751254540594752243'
    '52584907711670556013604839586446706324415722155397'
    '53697817977846174064955149290862569321978468622482'
    '83972241375657056057490261407972968652414535100474'
    '82166370484403199890008895243450658541227588666881'
    '16427171479924442928230863465674813919123162824586'
    '17866458359124566529476545682848912883142607690042'
    '24219022671055626321111109370544217506941658960408'
    '07198403850962455444362981230987879927244284909188'
    '84580156166097919133875499200524063689912560717606'
    '05886116467109405077541002256983155200055935729725'
    '71636269561882670428252483600823257530420752963450'
)





def 		_UpperCAmelCase   (							__A							:   str      ):
				a_		:  Tuple											=      1
				for digit in s:
								product *= int(__A      )
				return product





def 		_UpperCAmelCase   (							__A							:   str = N      ):
				a_		:  Dict											=      -sys.maxsize - 1
				a_		:  Optional[int]											=      n[:13]
				a_		:  str											=      13
				while cur_index < len(__A      ) - 13:
								if int(n[cur_index]      ) >= int(substr[0]      ):
												a_		:  Tuple											=      substr[1:] + n[cur_index]
												cur_index += 1
								else:
												a_		:  Dict											=      max(__A						,		str_eval(__A      )      )
												a_		:  List[str]											=      n[cur_index : cur_index + 13]
												cur_index += 13
				return largest_product


if __name__ == "__main__":
		print(F"""{solution() = }""")




