

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding
class 		SCREAMING_SNAKE_CASE__					(		lowerCamelCase__   ):







						"""simple docstring"""




						lowercase  :				Union[str, Any]											=							['image_processor', 'tokenizer']
						lowercase  :				Dict											=							'EfficientNetImageProcessor'
						lowercase  :				Dict											=							('BertTokenizer', 'BertTokenizerFast')

						def __init__(				self , __UpperCamelCase , __UpperCamelCase    )							->	Optional[Any]:




									'''simple docstring'''


									super().__init__(__UpperCamelCase , __UpperCamelCase    )

						def __call__(				self , __UpperCamelCase=None , __UpperCamelCase=None , __UpperCamelCase="max_length" , __UpperCamelCase=64 , __UpperCamelCase=None , **__UpperCamelCase    )							->	Optional[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:
												__UpperCamelCase    :    str								=      self.tokenizer(
												    __UpperCamelCase , padding=__UpperCamelCase , max_length=__UpperCamelCase , return_tensors=__UpperCamelCase , **__UpperCamelCase    )

									if images is not None:
												__UpperCamelCase    :    Union[str, Any]								=      self.image_processor(__UpperCamelCase , return_tensors=__UpperCamelCase , **__UpperCamelCase    )

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

						def __lowerCamelCase					(				self , *__UpperCamelCase , **__UpperCamelCase    )							->	Any:




									'''simple docstring'''


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

						def __lowerCamelCase					(				self , *__UpperCamelCase , **__UpperCamelCase    )							->	Any:




									'''simple docstring'''


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




						@property
						def __lowerCamelCase					(				self    )							->	Optional[int]:




									'''simple docstring'''


									__UpperCamelCase    :    int								=      self.tokenizer.model_input_names
									__UpperCamelCase    :    Tuple								=      self.image_processor.model_input_names
									return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names    )    )


lowercase     :       dict[str, float]        =       {
    "kilogram": 1,
    "gram": pow(10, 3),
    "milligram": pow(10, 6),
    "metric-ton": pow(10, -3),
    "long-ton": 0.0009842073,
    "short-ton": 0.0011023122,
    "pound": 2.2046244202,
    "stone": 0.1574731728,
    "ounce": 35.273990723,
    "carrat": 5000,
    "atomic-mass-unit": 6.0_22_13_66_52E26,
}

lowercase     :       dict[str, float]        =       {
    "kilogram": 1,
    "gram": pow(10, -3),
    "milligram": pow(10, -6),
    "metric-ton": pow(10, 3),
    "long-ton": 1016.04608,
    "short-ton": 907.184,
    "pound": 0.453592,
    "stone": 6.35029,
    "ounce": 0.0283495,
    "carrat": 0.0002,
    "atomic-mass-unit": 1.6_60_54_01_99E-27,
}







def  UpperCAmelCase_   (_lowerCAmelCase :		str     ,			_lowerCAmelCase :		str     ,			_lowerCAmelCase :		float		):
			if to_type not in KILOGRAM_CHART or from_type not in WEIGHT_TYPE_CHART:
						__UpperCamelCase    :    Dict								=      (
						    F'''Invalid \'from_type\' or \'to_type\' value: {from_type!r}, {to_type!r}\n'''
						    F'''Supported values are: {", ".join(_lowerCAmelCase		)}'''
						)
						raise ValueError(_lowerCAmelCase		)
			return value * KILOGRAM_CHART[to_type] * WEIGHT_TYPE_CHART[from_type]


if __name__ == "__main__":
					import doctest

					doctest.testmod()