






"""simple docstring"""

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
    is_vision_available,
)


lowercase           =							{
    '''configuration_mobilevitv2''': [
        '''MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''MobileViTV2Config''',
        '''MobileViTV2OnnxConfig''',
    ],
}


try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase           =							[
			    '''MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST''',
			    '''MobileViTV2ForImageClassification''',
			    '''MobileViTV2ForSemanticSegmentation''',
			    '''MobileViTV2Model''',
			    '''MobileViTV2PreTrainedModel''',
			]

if TYPE_CHECKING:
			from .configuration_mobilevitva import (
			    MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP,
			    MobileViTVaConfig,
			    MobileViTVaOnnxConfig,
			)

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_mobilevitva import (
						    MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST,
						    MobileViTVaForImageClassification,
						    MobileViTVaForSemanticSegmentation,
						    MobileViTVaModel,
						    MobileViTVaPreTrainedModel,
						)

else:
			import sys

			lowercase           =							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)







"""simple docstring"""






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


class 			SCREAMING_SNAKE_CASE_  (   _lowercase):




							'''simple docstring'''





							__magic_name__					:     Union[str, Any]				  =  ['''image_processor''', '''tokenizer''']
							__magic_name__					:     Optional[int]				  =  '''EfficientNetImageProcessor'''
							__magic_name__					:     Optional[Any]				  =  ('''BertTokenizer''', '''BertTokenizerFast''')




							def __init__(						self	,					lowerCamelCase__	,					lowerCamelCase__)   ->	str:







								'''simple docstring'''




								super().__init__(lowerCamelCase__	,					lowerCamelCase__)




							def __call__(						self	,					lowerCamelCase__=None	,					lowerCamelCase__=None	,					lowerCamelCase__="max_length"	,					lowerCamelCase__=64	,					lowerCamelCase__=None	,					**lowerCamelCase__)   ->	List[str]:







								'''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:
									snake_case__  :						int		=      self.tokenizer(
									    lowerCamelCase__	,					padding=lowerCamelCase__	,					max_length=lowerCamelCase__	,					return_tensors=lowerCamelCase__	,					**lowerCamelCase__)

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

								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(**lowerCamelCase__)	,					tensor_type=lowerCamelCase__)




							def        UpperCAmelCase (						self	,					*lowerCamelCase__	,					**lowerCamelCase__)   ->	int:







								'''simple docstring'''




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




							def        UpperCAmelCase (						self	,					*lowerCamelCase__	,					**lowerCamelCase__)   ->	Optional[Any]:







								'''simple docstring'''




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







							@property
							def        UpperCAmelCase (						self)   ->	Tuple:







								'''simple docstring'''




								snake_case__  :						Dict		=      self.tokenizer.model_input_names
								snake_case__  :						Optional[int]		=      self.image_processor.model_input_names
								return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))





