code: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  import warnings
  
  from ...processing_utils import ProcessorMixin
  from ...tokenization_utils_base import BatchEncoding
  
  
  
  
  
  
  class 							__snake_case    (				__magic_name__       ):
  	__lowerCAmelCase						=     ['''image_processor''', '''tokenizer''']
  	__lowerCAmelCase						=     '''AutoImageProcessor'''
  	__lowerCAmelCase						=     '''AutoTokenizer'''
  
  
  
  
  
  	def __init__(		self			,					UpperCamelCase_=None			,					UpperCamelCase_=None			,					**UpperCamelCase_		)			->		str:
  		snake_case__  					=      None
  		if "feature_extractor" in kwargs:
  			warnings.warn(
  			    'The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'
  			    ' instead.'			,					UpperCamelCase_			,					)
  			snake_case__  					=      kwargs.pop('feature_extractor'		)
  
  		snake_case__  					=      image_processor if image_processor is not None else feature_extractor
  		if image_processor is None:
  			raise ValueError('You have to specify an image_processor.'		)
  		if tokenizer is None:
  			raise ValueError('You have to specify a tokenizer.'		)
  
  		super().__init__(UpperCamelCase_			,					UpperCamelCase_		)
  		snake_case__  					=      self.image_processor
  
  
  
  
  
  	def __call__(		self			,					UpperCamelCase_=None			,					UpperCamelCase_=None			,					UpperCamelCase_=None			,					**UpperCamelCase_		)			->		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__  					=      self.tokenizer(UpperCamelCase_			,					return_tensors=UpperCamelCase_			,					**UpperCamelCase_		)
  
  		if images is not None:
  			snake_case__  					=      self.image_processor(UpperCamelCase_			,					return_tensors=UpperCamelCase_			,					**UpperCamelCase_		)
  
  		if text is not None and images is not None:
  			snake_case__  					=      image_features.pixel_values
  			return encoding
  		elif text is not None:
  			return encoding
  		else:
  			return BatchEncoding(data=dict(**UpperCamelCase_		)			,					tensor_type=UpperCamelCase_		)
  
  
  
  
  
  	def      _snake_case      (		self			,					*UpperCamelCase_			,					**UpperCamelCase_		)			->		Optional[Any]:
  		return self.tokenizer.batch_decode(*UpperCamelCase_			,					**UpperCamelCase_		)
  
  
  
  
  
  	def      _snake_case      (		self			,					*UpperCamelCase_			,					**UpperCamelCase_		)			->		Any:
  		return self.tokenizer.decode(*UpperCamelCase_			,					**UpperCamelCase_		)
  
  
  
  
  
  	@property
  	def      _snake_case      (		self		)			->		Tuple:
  		snake_case__  					=      self.tokenizer.model_input_names
  		snake_case__  					=      self.image_processor.model_input_names
  		return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names		)		)
  
  
  
  
  
  	@property
  	def      _snake_case      (		self		)			->		List[str]:
  		warnings.warn(
  		    '`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'			,					UpperCamelCase_			,					)
  		return self.image_processor_class
  
  
  
  
  
  	@property
  	def      _snake_case      (		self		)			->		str:
  		warnings.warn(
  		    '`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'			,					UpperCamelCase_			,					)
  		return self.image_processor
  
  
  
  
style_context: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  from collections import OrderedDict
  from typing import Mapping
  
  from packaging import version
  
  from ...configuration_utils import PretrainedConfig
  from ...onnx import OnnxConfig
  from ...utils import logging
  
  
  a__				: Dict									=    logging.get_logger(__name__)
  
  a__				: Tuple									=    {
      '''apple/mobilevitv2-1.0''': '''https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json''',
  }
  
  
  
  
  
  
  class 							__snake_case    (				__magic_name__       ):
  	__lowerCAmelCase						=     '''mobilevitv2'''
  
  
  
  
  
  	def __init__(		self			,					UpperCamelCase_=3			,					UpperCamelCase_=256			,					UpperCamelCase_=2			,					UpperCamelCase_=2.0			,					UpperCamelCase_="swish"			,					UpperCamelCase_=3			,					UpperCamelCase_=32			,					UpperCamelCase_=0.1			,					UpperCamelCase_=0.0_2			,					UpperCamelCase_=1E-5			,					UpperCamelCase_=512			,					UpperCamelCase_=[6, 12, 18]			,					UpperCamelCase_=0.1			,					UpperCamelCase_=255			,					UpperCamelCase_=[2, 4, 3]			,					UpperCamelCase_=[128, 192, 256]			,					UpperCamelCase_=1.0			,					UpperCamelCase_=2			,					UpperCamelCase_=0.0			,					UpperCamelCase_=0.0			,					**UpperCamelCase_			,					)			->		Union[str, Any]:
  		super().__init__(**UpperCamelCase_		)
  
  		snake_case__  					=      num_channels
  		snake_case__  					=      image_size
  		snake_case__  					=      patch_size
  		snake_case__  					=      expand_ratio
  		snake_case__  					=      hidden_act
  		snake_case__  					=      conv_kernel_size
  		snake_case__  					=      output_stride
  		snake_case__  					=      initializer_range
  		snake_case__  					=      layer_norm_eps
  		snake_case__  					=      n_attn_blocks
  		snake_case__  					=      base_attn_unit_dims
  		snake_case__  					=      width_multiplier
  		snake_case__  					=      ffn_multiplier
  		snake_case__  					=      ffn_dropout
  		snake_case__  					=      attn_dropout
  		snake_case__  					=      classifier_dropout_prob
  
  		# decode head attributes for semantic segmentation
  		snake_case__  					=      aspp_out_channels
  		snake_case__  					=      atrous_rates
  		snake_case__  					=      aspp_dropout_prob
  		snake_case__  					=      semantic_loss_ignore_index
  
  
  
  
  
  
  class 							__snake_case    (				__magic_name__       ):
  	__lowerCAmelCase						=     version.parse('''1.11'''       )
  
  
  
  
  
  	@property
  	def      _snake_case      (		self		)			->		Mapping[str, Mapping[int, str]]:
  		return OrderedDict([('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'})]		)
  
  
  
  
  
  	@property
  	def      _snake_case      (		self		)			->		Mapping[str, Mapping[int, str]]:
  		if self.task == "image-classification":
  			return OrderedDict([('logits', {0: 'batch'})]		)
  		else:
  			return OrderedDict([('last_hidden_state', {0: 'batch'}), ('pooler_output', {0: 'batch'})]		)
  
  
  
  
  
  	@property
  	def      _snake_case      (		self		)			->		float:
  		return 1E-4
  
  
  
  