



import unittest

from transformers import FunnelConfig, FunnelTokenizer, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
			import torch

			from transformers import (
			    MODEL_FOR_PRETRAINING_MAPPING,
			    FunnelBaseModel,
			    FunnelForMaskedLM,
			    FunnelForMultipleChoice,
			    FunnelForPreTraining,
			    FunnelForQuestionAnswering,
			    FunnelForSequenceClassification,
			    FunnelForTokenClassification,
			    FunnelModel,
			)

class 			_a     :



			def __init__( self       :							Dict      ,  _lowercase       :							Any      ,  _lowercase       :							Optional[Any]=13      ,  _lowercase       :							List[Any]=7      ,  _lowercase       :							Optional[Any]=True      ,  _lowercase       :							int=True      ,  _lowercase       :							int=True      ,  _lowercase       :							str=True      ,  _lowercase       :							Optional[int]=99      ,  _lowercase       :							List[str]=[1, 1, 2]      ,  _lowercase       :							Union[str, Any]=1      ,  _lowercase       :							List[str]=32      ,  _lowercase       :							Optional[int]=4      ,  _lowercase       :							str=8      ,  _lowercase       :							str=37      ,  _lowercase       :							int="gelu_new"      ,  _lowercase       :							str=0.1      ,  _lowercase       :							int=0.1      ,  _lowercase       :							str=0.0      ,  _lowercase       :							Any=512      ,  _lowercase       :							Optional[int]=3      ,  _lowercase       :							List[Any]=0.02      ,  _lowercase       :							Any=3      ,  _lowercase       :							Any=4      ,  _lowercase       :							Optional[Any]=None      ,  _lowercase       :							Union[str, Any]=False      ,  )       ->				List[Any]:
									snake_case      : Optional[int]							=   parent
									snake_case      : Union[str, Any]							=   batch_size
									snake_case      : Union[str, Any]							=   seq_length
									snake_case      : Optional[Any]							=   is_training
									snake_case      : Any							=   use_input_mask
									snake_case      : Any							=   use_token_type_ids
									snake_case      : int							=   use_labels
									snake_case      : List[str]							=   vocab_size
									snake_case      : Optional[int]							=   block_sizes
									snake_case      : Union[str, Any]							=   num_decoder_layers
									snake_case      : List[Any]							=   d_model
									snake_case      : List[str]							=   n_head
									snake_case      : Optional[Any]							=   d_head
									snake_case      : Tuple							=   d_inner
									snake_case      : str							=   hidden_act
									snake_case      : str							=   hidden_dropout
									snake_case      : str							=   attention_dropout
									snake_case      : Any							=   activation_dropout
									snake_case      : Optional[int]							=   max_position_embeddings
									snake_case      : Dict							=   type_vocab_size
									snake_case      : Optional[Any]							=   2
									snake_case      : Dict							=   num_labels
									snake_case      : Optional[int]							=   num_choices
									snake_case      : Tuple							=   scope
									snake_case      : Optional[int]							=   initializer_std

									# Used in the tests to check the size of the first attention layer
									snake_case      : str							=   n_head
									# Used in the tests to check the size of the first hidden state
									snake_case      : str							=   self.d_model
									# Used in the tests to check the number of output hidden states/attentions
									snake_case      : Tuple							=   sum(self.block_sizes		) + (0 if base else self.num_decoder_layers)
									# FunnelModel adds two hidden layers: input embeddings and the sum of the upsampled encoder hidden state with
									# the last hidden state of the first block (which is the first hidden state of the decoder).
									if not base:
															snake_case      : Union[str, Any]							=   self.num_hidden_layers + 2



			def 							__lowercase				( self       :							Any		)       ->				int:
									snake_case      : List[str]							=   ids_tensor([self.batch_size, self.seq_length]      ,  self.vocab_size		)

									snake_case      : List[Any]							=   None
									if self.use_input_mask:
															snake_case      : Dict							=   ids_tensor([self.batch_size, self.seq_length]      ,  vocab_size=2		)

									snake_case      : Union[str, Any]							=   None
									if self.use_token_type_ids:
															snake_case      : Any							=   ids_tensor([self.batch_size, self.seq_length]      ,  self.type_vocab_size		)

									snake_case      : Tuple							=   None
									snake_case      : List[str]							=   None
									snake_case      : str							=   None
									if self.use_labels:
															snake_case      : Optional[Any]							=   ids_tensor([self.batch_size]      ,  self.type_sequence_label_size		)
															snake_case      : List[Any]							=   ids_tensor([self.batch_size, self.seq_length]      ,  self.num_labels		)
															snake_case      : Tuple							=   ids_tensor([self.batch_size]      ,  self.num_choices		)
															snake_case      : int							=   ids_tensor([self.batch_size, self.seq_length]      ,  1		)

									snake_case      : str							=   self.get_config()

									return (
									    config,
									    input_ids,
									    token_type_ids,
									    input_mask,
									    sequence_labels,
									    token_labels,
									    choice_labels,
									    fake_token_labels,
									)



			def 							__lowercase				( self       :							str		)       ->				Tuple:
									return FunnelConfig(
									    vocab_size=self.vocab_size      ,  block_sizes=self.block_sizes      ,  num_decoder_layers=self.num_decoder_layers      ,  d_model=self.d_model      ,  n_head=self.n_head      ,  d_head=self.d_head      ,  d_inner=self.d_inner      ,  hidden_act=self.hidden_act      ,  hidden_dropout=self.hidden_dropout      ,  attention_dropout=self.attention_dropout      ,  activation_dropout=self.activation_dropout      ,  max_position_embeddings=self.max_position_embeddings      ,  type_vocab_size=self.type_vocab_size      ,  initializer_std=self.initializer_std      ,  )



			def 							__lowercase				( self       :							Any      ,  _lowercase       :							List[str]      ,  _lowercase       :							int      ,  _lowercase       :							List[str]      ,  _lowercase       :							str      ,  _lowercase       :							List[Any]      ,  _lowercase       :							Union[str, Any]      ,  _lowercase       :							Union[str, Any]      ,  _lowercase       :							Union[str, Any]      ,  )       ->				Union[str, Any]:
									snake_case      : Tuple							=   FunnelModel(config=_lowercase		)
									model.to(_lowercase		)
									model.eval()
									snake_case      : Optional[int]							=   model(_lowercase      ,  attention_mask=_lowercase      ,  token_type_ids=_lowercase		)
									snake_case      : Optional[Any]							=   model(_lowercase      ,  token_type_ids=_lowercase		)
									snake_case      : int							=   model(_lowercase		)
									self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.d_model)		)

									snake_case      : Optional[Any]							=   False
									snake_case      : Dict							=   model(_lowercase		)
									self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.d_model)		)

									snake_case      : Any							=   False
									snake_case      : int							=   model(_lowercase		)
									self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.d_model)		)



			def 							__lowercase				( self       :							Any      ,  _lowercase       :							List[str]      ,  _lowercase       :							Any      ,  _lowercase       :							Optional[Any]      ,  _lowercase       :							Union[str, Any]      ,  _lowercase       :							int      ,  _lowercase       :							Dict      ,  _lowercase       :							Any      ,  _lowercase       :							List[Any]      ,  )       ->				Dict:
									snake_case      : Union[str, Any]							=   FunnelBaseModel(config=_lowercase		)
									model.to(_lowercase		)
									model.eval()
									snake_case      : Union[str, Any]							=   model(_lowercase      ,  attention_mask=_lowercase      ,  token_type_ids=_lowercase		)
									snake_case      : Tuple							=   model(_lowercase      ,  token_type_ids=_lowercase		)
									snake_case      : str							=   model(_lowercase		)
									self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, 2, self.d_model)		)

									snake_case      : Optional[Any]							=   False
									snake_case      : List[str]							=   model(_lowercase		)
									self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, 3, self.d_model)		)

									snake_case      : Union[str, Any]							=   False
									snake_case      : List[str]							=   model(_lowercase		)
									self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, 2, self.d_model)		)



			def 							__lowercase				( self       :							Optional[Any]      ,  _lowercase       :							int      ,  _lowercase       :							List[str]      ,  _lowercase       :							List[str]      ,  _lowercase       :							Dict      ,  _lowercase       :							Dict      ,  _lowercase       :							List[str]      ,  _lowercase       :							Optional[int]      ,  _lowercase       :							Optional[Any]      ,  )       ->				Optional[Any]:
									snake_case      : Optional[Any]							=   self.num_labels
									snake_case      : List[Any]							=   FunnelForPreTraining(config=_lowercase		)
									model.to(_lowercase		)
									model.eval()
									snake_case      : Dict							=   model(_lowercase      ,  attention_mask=_lowercase      ,  token_type_ids=_lowercase      ,  labels=_lowercase		)
									self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length)		)



			def 							__lowercase				( self       :							Optional[Any]      ,  _lowercase       :							List[str]      ,  _lowercase       :							Tuple      ,  _lowercase       :							Tuple      ,  _lowercase       :							List[str]      ,  _lowercase       :							Tuple      ,  _lowercase       :							str      ,  _lowercase       :							Any      ,  _lowercase       :							Tuple      ,  )       ->				Dict:
									snake_case      : Tuple							=   FunnelForMaskedLM(config=_lowercase		)
									model.to(_lowercase		)
									model.eval()
									snake_case      : Optional[int]							=   model(_lowercase      ,  attention_mask=_lowercase      ,  token_type_ids=_lowercase      ,  labels=_lowercase		)
									self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length, self.vocab_size)		)



			def 							__lowercase				( self       :							Optional[Any]      ,  _lowercase       :							List[str]      ,  _lowercase       :							List[Any]      ,  _lowercase       :							Union[str, Any]      ,  _lowercase       :							List[str]      ,  _lowercase       :							Optional[Any]      ,  _lowercase       :							List[Any]      ,  _lowercase       :							int      ,  _lowercase       :							Any      ,  )       ->				str:
									snake_case      : List[Any]							=   self.num_labels
									snake_case      : Dict							=   FunnelForSequenceClassification(_lowercase		)
									model.to(_lowercase		)
									model.eval()
									snake_case      : List[Any]							=   model(_lowercase      ,  attention_mask=_lowercase      ,  token_type_ids=_lowercase      ,  labels=_lowercase		)
									self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.num_labels)		)



			def 							__lowercase				( self       :							List[str]      ,  _lowercase       :							Optional[Any]      ,  _lowercase       :							str      ,  _lowercase       :							str      ,  _lowercase       :							Any      ,  _lowercase       :							int      ,  _lowercase       :							Tuple      ,  _lowercase       :							List[str]      ,  _lowercase       :							Optional[int]      ,  )       ->				Any:
									snake_case      : List[str]							=   self.num_choices
									snake_case      : List[Any]							=   FunnelForMultipleChoice(config=_lowercase		)
									model.to(_lowercase		)
									model.eval()
									snake_case      : Tuple							=   input_ids.unsqueeze(1		).expand(-1      ,  self.num_choices      ,  -1		).contiguous()
									snake_case      : List[str]							=   token_type_ids.unsqueeze(1		).expand(-1      ,  self.num_choices      ,  -1		).contiguous()
									snake_case      : Union[str, Any]							=   input_mask.unsqueeze(1		).expand(-1      ,  self.num_choices      ,  -1		).contiguous()
									snake_case      : str							=   model(
									    _lowercase      ,  attention_mask=_lowercase      ,  token_type_ids=_lowercase      ,  labels=_lowercase      ,  )
									self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.num_choices)		)



			def 							__lowercase				( self       :							Optional[int]      ,  _lowercase       :							Optional[int]      ,  _lowercase       :							List[str]      ,  _lowercase       :							Any      ,  _lowercase       :							Dict      ,  _lowercase       :							Optional[int]      ,  _lowercase       :							Optional[int]      ,  _lowercase       :							Tuple      ,  _lowercase       :							Optional[Any]      ,  )       ->				Tuple:
									snake_case      : str							=   self.num_labels
									snake_case      : Optional[int]							=   FunnelForTokenClassification(config=_lowercase		)
									model.to(_lowercase		)
									model.eval()
									snake_case      : Any							=   model(_lowercase      ,  attention_mask=_lowercase      ,  token_type_ids=_lowercase      ,  labels=_lowercase		)
									self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length, self.num_labels)		)



			def 							__lowercase				( self       :							List[str]      ,  _lowercase       :							List[Any]      ,  _lowercase       :							int      ,  _lowercase       :							Optional[int]      ,  _lowercase       :							Optional[Any]      ,  _lowercase       :							Any      ,  _lowercase       :							List[Any]      ,  _lowercase       :							Dict      ,  _lowercase       :							Tuple      ,  )       ->				Union[str, Any]:
									snake_case      : str							=   FunnelForQuestionAnswering(config=_lowercase		)
									model.to(_lowercase		)
									model.eval()
									snake_case      : Dict							=   model(
									    _lowercase      ,  attention_mask=_lowercase      ,  token_type_ids=_lowercase      ,  start_positions=_lowercase      ,  end_positions=_lowercase      ,  )
									self.parent.assertEqual(result.start_logits.shape      ,  (self.batch_size, self.seq_length)		)
									self.parent.assertEqual(result.end_logits.shape      ,  (self.batch_size, self.seq_length)		)



			def 							__lowercase				( self       :							Dict		)       ->				str:
									snake_case      : str							=   self.prepare_config_and_inputs()
									(
									    snake_case 
									)      : Optional[Any]							=   config_and_inputs
									snake_case      : int							=   {"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
									return config, inputs_dict



@require_torch
class 			_a     (   SCREAMING_SNAKE_CASE__    ,  SCREAMING_SNAKE_CASE__    ,  unittest.TestCase):
			__magic_name__    				=    False
			__magic_name__    				=    False
			__magic_name__    				=    (
			    (
			        FunnelModel,
			        FunnelForMaskedLM,
			        FunnelForPreTraining,
			        FunnelForQuestionAnswering,
			        FunnelForTokenClassification,
			    )
			    if is_torch_available()
			    else ()
			)
			__magic_name__    				=    (
			    {
			        """feature-extraction""": (FunnelBaseModel, FunnelModel),
			        """fill-mask""": FunnelForMaskedLM,
			        """question-answering""": FunnelForQuestionAnswering,
			        """text-classification""": FunnelForSequenceClassification,
			        """token-classification""": FunnelForTokenClassification,
			        """zero-shot""": FunnelForSequenceClassification,
			    }
			    if is_torch_available()
			    else {}
			)



			def 							__lowercase				( self       :							Tuple      ,  _lowercase       :							Union[str, Any]      ,  _lowercase       :							Union[str, Any]      ,  _lowercase       :							List[Any]=False		)       ->				List[str]:
									snake_case      : Optional[Any]							=   super()._prepare_for_class(_lowercase      ,  _lowercase      ,  return_labels=_lowercase		)

									if return_labels:
															if model_class in get_values(_lowercase		):
																					snake_case      : Optional[int]							=   torch.zeros(
																					    (self.model_tester.batch_size, self.model_tester.seq_length)      ,  dtype=torch.long      ,  device=_lowercase		)
									return inputs_dict



			def 							__lowercase				( self       :							Dict		)       ->				Dict:
									snake_case      : str							=   FunnelModelTester(self		)
									snake_case      : Union[str, Any]							=   ConfigTester(self      ,  config_class=_lowercase		)



			def 							__lowercase				( self       :							Dict		)       ->				List[str]:
									self.config_tester.run_common_tests()



			def 							__lowercase				( self       :							Any		)       ->				str:
									snake_case      : Optional[Any]							=   self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_model(*_lowercase		)



			def 							__lowercase				( self       :							Tuple		)       ->				int:
									snake_case      : int							=   self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_pretraining(*_lowercase		)



			def 							__lowercase				( self       :							Any		)       ->				List[Any]:
									snake_case      : Dict							=   self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_masked_lm(*_lowercase		)



			def 							__lowercase				( self       :							List[Any]		)       ->				str:
									snake_case      : Any							=   self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_token_classification(*_lowercase		)



			def 							__lowercase				( self       :							Optional[int]		)       ->				Any:
									snake_case      : List[str]							=   self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_question_answering(*_lowercase		)



			def 							__lowercase				( self       :							Optional[int]      ,  _lowercase       :							Dict		)       ->				List[Any]:
									if hasattr(_lowercase      ,  "weight"		) and module.weight is not None:
															module.weight.data.fill_(3		)
									if hasattr(_lowercase      ,  "bias"		) and module.bias is not None:
															module.bias.data.fill_(3		)

									for param in ["r_w_bias", "r_r_bias", "r_kernel", "r_s_bias", "seg_embed"]:
															if hasattr(_lowercase      ,  _lowercase		) and getattr(_lowercase      ,  _lowercase		) is not None:
																					snake_case      : Union[str, Any]							=   getattr(_lowercase      ,  _lowercase		)
																					weight.data.fill_(3		)



@require_torch
class 			_a     (   SCREAMING_SNAKE_CASE__    ,  unittest.TestCase):
			__magic_name__    				=    False
			__magic_name__    				=    False
			__magic_name__    				=    (
			    (FunnelBaseModel, FunnelForMultipleChoice, FunnelForSequenceClassification) if is_torch_available() else ()
			)



			def 							__lowercase				( self       :							int		)       ->				str:
									snake_case      : int							=   FunnelModelTester(self      ,  base=_lowercase		)
									snake_case      : Optional[Any]							=   ConfigTester(self      ,  config_class=_lowercase		)



			def 							__lowercase				( self       :							List[Any]		)       ->				Dict:
									self.config_tester.run_common_tests()



			def 							__lowercase				( self       :							List[str]		)       ->				Dict:
									snake_case      : Optional[Any]							=   self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_base_model(*_lowercase		)



			def 							__lowercase				( self       :							List[Any]		)       ->				Tuple:
									snake_case      : List[Any]							=   self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_sequence_classification(*_lowercase		)



			def 							__lowercase				( self       :							Optional[Any]		)       ->				List[str]:
									snake_case      : Optional[int]							=   self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_multiple_choice(*_lowercase		)



			def 							__lowercase				( self       :							Any		)       ->				Dict:
									snake_case      : Dict							=   self.model_tester.prepare_config_and_inputs_for_common()
									snake_case      : Dict							=   True

									for model_class in self.all_model_classes:
															if model_class.__name__ == "FunnelBaseModel":
																					continue
															snake_case      : str							=   model_class(_lowercase		)
															model.to(_lowercase		)
															model.train()
															snake_case      : int							=   self._prepare_for_class(_lowercase      ,  _lowercase      ,  return_labels=_lowercase		)
															snake_case      : Tuple							=   model(**_lowercase		).loss
															loss.backward()



			def 							__lowercase				( self       :							str      ,  _lowercase       :							Optional[int]		)       ->				Optional[Any]:
									if hasattr(_lowercase      ,  "weight"		) and module.weight is not None:
															module.weight.data.fill_(3		)
									if hasattr(_lowercase      ,  "bias"		) and module.bias is not None:
															module.bias.data.fill_(3		)

									for param in ["r_w_bias", "r_r_bias", "r_kernel", "r_s_bias", "seg_embed"]:
															if hasattr(_lowercase      ,  _lowercase		) and getattr(_lowercase      ,  _lowercase		) is not None:
																					snake_case      : Tuple							=   getattr(_lowercase      ,  _lowercase		)
																					weight.data.fill_(3		)



@require_torch
@require_sentencepiece
@require_tokenizers
class 			_a     (   unittest.TestCase):



			def 							__lowercase				( self       :							int		)       ->				Tuple:
									snake_case      : str							=   13
									snake_case      : Union[str, Any]							=   7
									snake_case      : Union[str, Any]							=   torch.arange(0      ,  batch_size * sequence_length		).long().reshape(_lowercase      ,  _lowercase		)
									snake_case      : Optional[int]							=   [0, 1, 2, 3, 4, 5, 6, 4, 1, 3, 5, 0, 1]
									snake_case      : Any							=   torch.tensor([[2] + [0] * a + [1] * (sequence_length - a - 1) for a in lengths]		)

									snake_case      : Tuple							=   FunnelModel.from_pretrained("sgugger/funnel-random-tiny"		)
									snake_case      : int							=   model(_lowercase      ,  token_type_ids=_lowercase		)[0].abs()

									snake_case      : List[Any]							=   torch.tensor(2344.8352		)
									snake_case      : Optional[Any]							=   torch.tensor(0.8052		)
									self.assertTrue(torch.allclose(output.sum()      ,  _lowercase      ,  atol=1E-4		)		)
									self.assertTrue(torch.allclose(output.mean()      ,  _lowercase      ,  atol=1E-4		)		)

									snake_case      : int							=   torch.tensor([[1] * 7, [1] * 4 + [0] * 3] * 6 + [[0, 1, 1, 0, 0, 1, 1]]		)
									snake_case      : List[Any]							=   model(_lowercase      ,  attention_mask=_lowercase      ,  token_type_ids=_lowercase		)[0].abs()

									snake_case      : Optional[int]							=   torch.tensor(2343.8425		)
									snake_case      : Optional[int]							=   torch.tensor(0.8049		)
									self.assertTrue(torch.allclose(output.sum()      ,  _lowercase      ,  atol=1E-4		)		)
									self.assertTrue(torch.allclose(output.mean()      ,  _lowercase      ,  atol=1E-4		)		)



			@slow
			def 							__lowercase				( self       :							Optional[int]		)       ->				Optional[Any]:
									snake_case      : Optional[Any]							=   FunnelTokenizer.from_pretrained("huggingface/funnel-small"		)
									snake_case      : Tuple							=   FunnelModel.from_pretrained("huggingface/funnel-small"		)
									snake_case      : Tuple							=   tokenizer("Hello! I am the Funnel Transformer model."      ,  return_tensors="pt"		)
									snake_case      : Optional[int]							=   model(**_lowercase		)[0]

									snake_case      : str							=   torch.tensor(235.7246		)
									snake_case      : Tuple							=   torch.tensor(0.0256		)
									self.assertTrue(torch.allclose(output.sum()      ,  _lowercase      ,  atol=1E-4		)		)
									self.assertTrue(torch.allclose(output.mean()      ,  _lowercase      ,  atol=1E-4		)		)








"""simple docstring"""







from typing import TYPE_CHECKING

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


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


try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			A    =	[
			    '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

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



