



'''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


snake_case_				:			str						 =						logging.get_logger(__name__)

snake_case_				:			List[Any]						 =						{
    'apple/mobilevitv2-1.0': 'https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json',
}






class 							snake_case__			(							lowercase     ):
	lowercase__						       =    """mobilevitv2"""





	def __init__(				self      :       Optional[int]				,lowerCamelCase__      :       Optional[int]=3				,lowerCamelCase__      :       str=256				,lowerCamelCase__      :       Optional[Any]=2				,lowerCamelCase__      :       int=2.0				,lowerCamelCase__      :       List[Any]="swish"				,lowerCamelCase__      :       Any=3				,lowerCamelCase__      :       List[str]=32				,lowerCamelCase__      :       List[str]=0.1				,lowerCamelCase__      :       Dict=0.0_2				,lowerCamelCase__      :       List[Any]=1E-5				,lowerCamelCase__      :       List[str]=512				,lowerCamelCase__      :       Union[str, Any]=[6, 12, 18]				,lowerCamelCase__      :       Any=0.1				,lowerCamelCase__      :       List[str]=255				,lowerCamelCase__      :       List[str]=[2, 4, 3]				,lowerCamelCase__      :       List[Any]=[128, 192, 256]				,lowerCamelCase__      :       Union[str, Any]=1.0				,lowerCamelCase__      :       Optional[Any]=2				,lowerCamelCase__      :       Optional[Any]=0.0				,lowerCamelCase__      :       Optional[int]=0.0				,**lowerCamelCase__      :       Optional[int]				,):







							'''simple docstring'''
							super().__init__(**lowerCamelCase__				)

							_UpperCamelCase      :	List[Any]				       =     num_channels
							_UpperCamelCase      :	int				       =     image_size
							_UpperCamelCase      :	Tuple				       =     patch_size
							_UpperCamelCase      :	Tuple				       =     expand_ratio
							_UpperCamelCase      :	str				       =     hidden_act
							_UpperCamelCase      :	List[Any]				       =     conv_kernel_size
							_UpperCamelCase      :	Dict				       =     output_stride
							_UpperCamelCase      :	Union[str, Any]				       =     initializer_range
							_UpperCamelCase      :	Optional[int]				       =     layer_norm_eps
							_UpperCamelCase      :	List[str]				       =     n_attn_blocks
							_UpperCamelCase      :	Optional[Any]				       =     base_attn_unit_dims
							_UpperCamelCase      :	Tuple				       =     width_multiplier
							_UpperCamelCase      :	Optional[Any]				       =     ffn_multiplier
							_UpperCamelCase      :	List[Any]				       =     ffn_dropout
							_UpperCamelCase      :	Tuple				       =     attn_dropout
							_UpperCamelCase      :	List[Any]				       =     classifier_dropout_prob

							# decode head attributes for semantic segmentation
							_UpperCamelCase      :	Optional[Any]				       =     aspp_out_channels
							_UpperCamelCase      :	Optional[int]				       =     atrous_rates
							_UpperCamelCase      :	List[str]				       =     aspp_dropout_prob
							_UpperCamelCase      :	str				       =     semantic_loss_ignore_index






class 							snake_case__			(							lowercase     ):
	lowercase__						       =    version.parse("""1.11"""     )





	@property
	def 			UpperCamelCase_						(				self      :       Optional[Any]				):







							'''simple docstring'''
							return OrderedDict([('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'})]				)





	@property
	def 			UpperCamelCase_						(				self      :       int				):







							'''simple docstring'''
							if self.task == "image-classification":
													return OrderedDict([('logits', {0: 'batch'})]				)
							else:
													return OrderedDict([('last_hidden_state', {0: 'batch'}), ('pooler_output', {0: 'batch'})]				)





	@property
	def 			UpperCamelCase_						(				self      :       Any				):







							'''simple docstring'''
							return 1E-4







'''simple docstring'''
import os

from ...utils import logging
from .utils import DataProcessor, InputExample


snake_case_				:			Any						 =						logging.get_logger(__name__)






class 							lowercase__			(							lowercase     ):





	def __init__(				self      :       Union[str, Any]				,lowerCamelCase__      :       Tuple				,lowerCamelCase__      :       Optional[int]=None				):







							'''simple docstring'''
							_UpperCamelCase      :	Any				       =     language
							_UpperCamelCase      :	int				       =     train_language





	def 			UpperCamelCase_						(				self      :       Optional[int]				,lowerCamelCase__      :       Dict				):







							'''simple docstring'''
							_UpperCamelCase      :	Tuple				       =     self.language if self.train_language is None else self.train_language
							_UpperCamelCase      :	List[Any]				       =     self._read_tsv(os.path.join(lowerCamelCase__				,F'XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv'				)				)
							_UpperCamelCase      :	Union[str, Any]				       =     []
							for i, line in enumerate(lowerCamelCase__				):
													if i == 0:
																			continue
													_UpperCamelCase      :	Optional[Any]				       =     F'train-{i}'
													_UpperCamelCase      :	List[str]				       =     line[0]
													_UpperCamelCase      :	Union[str, Any]				       =     line[1]
													_UpperCamelCase      :	Tuple				       =     'contradiction' if line[2] == 'contradictory' else line[2]
													if not isinstance(lowerCamelCase__				,lowerCamelCase__				):
																			raise ValueError(F'Training input {text_a} is not a string'				)
													if not isinstance(lowerCamelCase__				,lowerCamelCase__				):
																			raise ValueError(F'Training input {text_b} is not a string'				)
													if not isinstance(lowerCamelCase__				,lowerCamelCase__				):
																			raise ValueError(F'Training label {label} is not a string'				)
													examples.append(InputExample(guid=lowerCamelCase__				,text_a=lowerCamelCase__				,text_b=lowerCamelCase__				,label=lowerCamelCase__				)				)
							return examples





	def 			UpperCamelCase_						(				self      :       Optional[Any]				,lowerCamelCase__      :       List[str]				):







							'''simple docstring'''
							_UpperCamelCase      :	Optional[int]				       =     self._read_tsv(os.path.join(lowerCamelCase__				,'XNLI-1.0/xnli.test.tsv'				)				)
							_UpperCamelCase      :	List[str]				       =     []
							for i, line in enumerate(lowerCamelCase__				):
													if i == 0:
																			continue
													_UpperCamelCase      :	Optional[int]				       =     line[0]
													if language != self.language:
																			continue
													_UpperCamelCase      :	Optional[int]				       =     F'test-{i}'
													_UpperCamelCase      :	Optional[int]				       =     line[6]
													_UpperCamelCase      :	List[str]				       =     line[7]
													_UpperCamelCase      :	str				       =     line[1]
													if not isinstance(lowerCamelCase__				,lowerCamelCase__				):
																			raise ValueError(F'Training input {text_a} is not a string'				)
													if not isinstance(lowerCamelCase__				,lowerCamelCase__				):
																			raise ValueError(F'Training input {text_b} is not a string'				)
													if not isinstance(lowerCamelCase__				,lowerCamelCase__				):
																			raise ValueError(F'Training label {label} is not a string'				)
													examples.append(InputExample(guid=lowerCamelCase__				,text_a=lowerCamelCase__				,text_b=lowerCamelCase__				,label=lowerCamelCase__				)				)
							return examples





	def 			UpperCamelCase_						(				self      :       str				):







							'''simple docstring'''
							return ["contradiction", "entailment", "neutral"]
snake_case_				:			int						 =						{
    'xnli': XnliProcessor,
}

snake_case_				:			Tuple						 =						{
    'xnli': 'classification',
}

snake_case_				:			Any						 =						{
    'xnli': 3,
}


