




import inspect
import unittest
import warnings
from typing import List

from transformers import EfficientFormerConfig
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

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


if is_torch_available():
    import torch

    from transformers import (
        MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
        MODEL_MAPPING,
        EfficientFormerForImageClassification,
        EfficientFormerForImageClassificationWithTeacher,
        EfficientFormerModel,
    )
    from transformers.models.efficientformer.modeling_efficientformer import (
        EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
    )


if is_vision_available():
    from PIL import Image

    from transformers import EfficientFormerImageProcessor





class 		A__    :






 def __init__(     self    ,					lowerCamelCase    ,					lowerCamelCase = 13    ,					lowerCamelCase = 64    ,					lowerCamelCase = 2    ,					lowerCamelCase = 3    ,					lowerCamelCase = 3    ,					lowerCamelCase = True    ,					lowerCamelCase = True    ,					lowerCamelCase = 128    ,					lowerCamelCase=[16, 32, 64, 128]    ,					lowerCamelCase = 7    ,					lowerCamelCase = 4    ,					lowerCamelCase = 37    ,					lowerCamelCase = "gelu"    ,					lowerCamelCase = 0.1    ,					lowerCamelCase = 0.1    ,					lowerCamelCase = 10    ,					lowerCamelCase = 0.0_2    ,					lowerCamelCase = 2    ,					lowerCamelCase = 1    ,					lowerCamelCase = 128    ,					lowerCamelCase = [2, 2, 2, 2]    ,					lowerCamelCase = 2    ,					lowerCamelCase = 2    ,					)				->       Union[str, Any]:




      """simple docstring"""






      __magic_name__ :							Optional[int]		       =							parent
      __magic_name__ :							str		       =							batch_size
      __magic_name__ :							Optional[Any]		       =							image_size
      __magic_name__ :							Optional[Any]		       =							patch_size
      __magic_name__ :							Optional[int]		       =							num_channels
      __magic_name__ :							int		       =							is_training
      __magic_name__ :							Optional[int]		       =							use_labels
      __magic_name__ :							List[Any]		       =							hidden_size
      __magic_name__ :							List[str]		       =							num_hidden_layers
      __magic_name__ :							List[str]		       =							num_attention_heads
      __magic_name__ :							List[Any]		       =							intermediate_size
      __magic_name__ :							int		       =							hidden_act
      __magic_name__ :							Union[str, Any]		       =							hidden_dropout_prob
      __magic_name__ :							str		       =							attention_probs_dropout_prob
      __magic_name__ :							Dict		       =							type_sequence_label_size
      __magic_name__ :							Optional[Any]		       =							initializer_range
      __magic_name__ :							Any		       =							encoder_stride
      __magic_name__ :							Any		       =							num_attention_outputs
      __magic_name__ :							Any		       =							embed_dim
      __magic_name__ :							Optional[int]		       =							embed_dim + 1
      __magic_name__ :							Optional[int]		       =							resolution
      __magic_name__ :							Tuple		       =							depths
      __magic_name__ :							List[str]		       =							hidden_sizes
      __magic_name__ :							Dict		       =							dim
      __magic_name__ :							Any		       =							mlp_expansion_ratio






 def 			lowercase				(     self						)				->       Any:




      """simple docstring"""






      __magic_name__ :							List[str]		       =							floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]						)

      __magic_name__ :							Optional[int]		       =							None
      if self.use_labels:
           __magic_name__ :							List[str]		       =							ids_tensor([self.batch_size]    ,					self.type_sequence_label_size						)

      __magic_name__ :							Optional[int]		       =							self.get_config()
      return config, pixel_values, labels






 def 			lowercase				(     self						)				->       int:




      """simple docstring"""






      return EfficientFormerConfig(
          image_size=self.image_size    ,					patch_size=self.patch_size    ,					num_channels=self.num_channels    ,					hidden_size=self.hidden_size    ,					num_hidden_layers=self.num_hidden_layers    ,					num_attention_heads=self.num_attention_heads    ,					intermediate_size=self.intermediate_size    ,					hidden_act=self.hidden_act    ,					hidden_dropout_prob=self.hidden_dropout_prob    ,					attention_probs_dropout_prob=self.attention_probs_dropout_prob    ,					is_decoder=lowerCamelCase    ,					initializer_range=self.initializer_range    ,					encoder_stride=self.encoder_stride    ,					resolution=self.resolution    ,					depths=self.depths    ,					hidden_sizes=self.hidden_sizes    ,					dim=self.dim    ,					mlp_expansion_ratio=self.mlp_expansion_ratio    ,					)






 def 			lowercase				(     self    ,					lowerCamelCase    ,					lowerCamelCase    ,					lowerCamelCase						)				->       Optional[Any]:




      """simple docstring"""






      __magic_name__ :							str		       =							EfficientFormerModel(config=lowerCamelCase						)
      model.to(lowerCamelCase						)
      model.eval()
      __magic_name__ :							int		       =							model(lowerCamelCase						)
      self.parent.assertEqual(result.last_hidden_state.shape    ,					(self.batch_size, self.seq_length, self.hidden_size)						)






 def 			lowercase				(     self    ,					lowerCamelCase    ,					lowerCamelCase    ,					lowerCamelCase						)				->       str:




      """simple docstring"""






      __magic_name__ :							Optional[Any]		       =							self.type_sequence_label_size
      __magic_name__ :							Optional[int]		       =							EfficientFormerForImageClassification(lowerCamelCase						)
      model.to(lowerCamelCase						)
      model.eval()
      __magic_name__ :							Dict		       =							model(lowerCamelCase    ,					labels=lowerCamelCase						)
      self.parent.assertEqual(result.logits.shape    ,					(self.batch_size, self.type_sequence_label_size)						)

      # test greyscale images
      __magic_name__ :							List[str]		       =							1
      __magic_name__ :							Tuple		       =							EfficientFormerForImageClassification(lowerCamelCase						)
      model.to(lowerCamelCase						)
      model.eval()

      __magic_name__ :							Optional[Any]		       =							floats_tensor([self.batch_size, 1, self.image_size, self.image_size]						)
      __magic_name__ :							int		       =							model(lowerCamelCase						)
      self.parent.assertEqual(result.logits.shape    ,					(self.batch_size, self.type_sequence_label_size)						)






 def 			lowercase				(     self						)				->       Tuple:




      """simple docstring"""






      __magic_name__ :							Dict		       =							self.prepare_config_and_inputs()
      (
          __magic_name__			
      ) :							Tuple		       =							config_and_inputs
      __magic_name__ :							str		       =							{'''pixel_values''': pixel_values}
      return config, inputs_dict





@require_torch
class 		A__    (       __SCREAMING_SNAKE_CASE		,					__SCREAMING_SNAKE_CASE		,					unittest.TestCase			):
 lowerCamelCase__		:			List[str]       =(
     (
         EfficientFormerModel,
         EfficientFormerForImageClassificationWithTeacher,
         EfficientFormerForImageClassification,
     )
     if is_torch_available()
     else ()
 )
 lowerCamelCase__		:			int       =(
     {
         "feature-extraction": EfficientFormerModel,
         "image-classification": (
             EfficientFormerForImageClassification,
             EfficientFormerForImageClassificationWithTeacher,
         ),
     }
     if is_torch_available()
     else {}
 )
 lowerCamelCase__		:			List[Any]       =False

 lowerCamelCase__		:			Optional[int]       =False
 lowerCamelCase__		:			Tuple       =False
 lowerCamelCase__		:			List[Any]       =False






 def 			lowercase				(     self						)				->       List[str]:




      """simple docstring"""






      __magic_name__ :							List[str]		       =							EfficientFormerModelTester(self						)
      __magic_name__ :							Dict		       =							ConfigTester(
          self    ,					config_class=lowerCamelCase    ,					has_text_modality=lowerCamelCase    ,					hidden_size=37						)






 def 			lowercase				(     self						)				->       int:




      """simple docstring"""






      self.config_tester.run_common_tests()






 @unittest.skip(reason='''EfficientFormer does not use inputs_embeds'''						)
 def 			lowercase				(     self						)				->       Union[str, Any]:




      """simple docstring"""






      pass






 @unittest.skip(reason='''EfficientFormer does not support input and output embeddings'''						)
 def 			lowercase				(     self						)				->       List[Any]:




      """simple docstring"""






      pass






 def 			lowercase				(     self						)				->       str:




      """simple docstring"""






      __magic_name__ :							int		       =							self.model_tester.prepare_config_and_inputs_for_common()

      for model_class in self.all_model_classes:
           __magic_name__ :							Tuple		       =							model_class(lowerCamelCase						)
           __magic_name__ :							Optional[int]		       =							inspect.signature(model.forward						)
           # signature.parameters is an OrderedDict => so arg_names order is deterministic
           __magic_name__ :							int		       =							[*signature.parameters.keys()]

           __magic_name__ :							int		       =							['''pixel_values''']
           self.assertListEqual(arg_names[:1]    ,					lowerCamelCase						)






 def 			lowercase				(     self						)				->       Tuple:




      """simple docstring"""






      def check_hidden_states_output(lowerCamelCase    ,					lowerCamelCase    ,					lowerCamelCase						):
           __magic_name__ :							List[Any]		       =							model_class(lowerCamelCase						)
           model.to(lowerCamelCase						)
           model.eval()

           with torch.no_grad():
                __magic_name__ :							str		       =							model(**self._prepare_for_class(lowerCamelCase    ,					lowerCamelCase						)						)

           __magic_name__ :							Optional[Any]		       =							outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

           __magic_name__ :							Any		       =							getattr(
               self.model_tester    ,					'''expected_num_hidden_layers'''    ,					self.model_tester.num_hidden_layers + 1						)
           self.assertEqual(len(lowerCamelCase						)    ,					lowerCamelCase						)

           if hasattr(self.model_tester    ,					'''encoder_seq_length'''						):
                __magic_name__ :							str		       =							self.model_tester.encoder_seq_length
                if hasattr(self.model_tester    ,					'''chunk_length'''						) and self.model_tester.chunk_length > 1:
                     __magic_name__ :							Tuple		       =							seq_length * self.model_tester.chunk_length
           else:
                __magic_name__ :							Any		       =							self.model_tester.seq_length

           self.assertListEqual(
               list(hidden_states[-1].shape[-2:]						)    ,					[seq_length, self.model_tester.hidden_size]    ,					)

           if config.is_encoder_decoder:
                __magic_name__ :							List[str]		       =							outputs.decoder_hidden_states

                self.assertIsInstance(lowerCamelCase    ,					(list, tuple)						)
                self.assertEqual(len(lowerCamelCase						)    ,					lowerCamelCase						)
                __magic_name__ :							Optional[int]		       =							getattr(self.model_tester    ,					'''seq_length'''    ,					lowerCamelCase						)
                __magic_name__ :							Optional[Any]		       =							getattr(self.model_tester    ,					'''decoder_seq_length'''    ,					lowerCamelCase						)

                self.assertListEqual(
                    list(hidden_states[-1].shape[-2:]						)    ,					[decoder_seq_length, self.model_tester.hidden_size]    ,					)

      __magic_name__ :							Optional[Any]		       =							self.model_tester.prepare_config_and_inputs_for_common()

      for model_class in self.all_model_classes:
           __magic_name__ :							Optional[int]		       =							True
           check_hidden_states_output(lowerCamelCase    ,					lowerCamelCase    ,					lowerCamelCase						)

           # check that output_hidden_states also work using config
           del inputs_dict["output_hidden_states"]
           __magic_name__ :							Dict		       =							True

           check_hidden_states_output(lowerCamelCase    ,					lowerCamelCase    ,					lowerCamelCase						)






 def 			lowercase				(     self    ,					lowerCamelCase    ,					lowerCamelCase    ,					lowerCamelCase=False						)				->       int:




      """simple docstring"""






      __magic_name__ :							Union[str, Any]		       =							super()._prepare_for_class(lowerCamelCase    ,					lowerCamelCase    ,					return_labels=lowerCamelCase						)

      if return_labels:
           if model_class.__name__ == "EfficientFormerForImageClassificationWithTeacher":
                del inputs_dict["labels"]

      return inputs_dict






 def 			lowercase				(     self						)				->       List[str]:




      """simple docstring"""






      __magic_name__ :							Any		       =							self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_model(*lowerCamelCase						)






 @unittest.skip(reason='''EfficientFormer does not implement masked image modeling yet'''						)
 def 			lowercase				(     self						)				->       List[Any]:




      """simple docstring"""






      __magic_name__ :							Union[str, Any]		       =							self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_masked_image_modeling(*lowerCamelCase						)






 def 			lowercase				(     self						)				->       Dict:




      """simple docstring"""






      __magic_name__ :							str		       =							self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_image_classification(*lowerCamelCase						)






 def 			lowercase				(     self						)				->       Tuple:




      """simple docstring"""






      if not self.model_tester.is_training:
           return

      __magic_name__ :							int		       =							self.model_tester.prepare_config_and_inputs_for_common()
      __magic_name__ :							int		       =							True

      for model_class in self.all_model_classes:
           # EfficientFormerForImageClassificationWithTeacher supports inference-only
           if (
               model_class in get_values(lowerCamelCase						)
               or model_class.__name__ == "EfficientFormerForImageClassificationWithTeacher"
           ):
                continue
           __magic_name__ :							List[str]		       =							model_class(lowerCamelCase						)
           model.to(lowerCamelCase						)
           model.train()
           __magic_name__ :							Dict		       =							self._prepare_for_class(lowerCamelCase    ,					lowerCamelCase    ,					return_labels=lowerCamelCase						)
           __magic_name__ :							Any		       =							model(**lowerCamelCase						).loss
           loss.backward()






 def 			lowercase				(     self						)				->       List[str]:




      """simple docstring"""






      __magic_name__ :							Any		       =							self.model_tester.prepare_config_and_inputs_for_common()

      __magic_name__ :							Optional[int]		       =							[
          {'''title''': '''multi_label_classification''', '''num_labels''': 2, '''dtype''': torch.float},
          {'''title''': '''single_label_classification''', '''num_labels''': 1, '''dtype''': torch.long},
          {'''title''': '''regression''', '''num_labels''': 1, '''dtype''': torch.float},
      ]

      for model_class in self.all_model_classes:
           if (
               model_class
               not in [
                   *get_values(lowerCamelCase						),
               ]
               or model_class.__name__ == "EfficientFormerForImageClassificationWithTeacher"
           ):
                continue

           for problem_type in problem_types:
                with self.subTest(msg=F'''Testing {model_class} with {problem_type["title"]}'''						):
                     __magic_name__ :							Dict		       =							problem_type['''title''']
                     __magic_name__ :							Optional[int]		       =							problem_type['''num_labels''']

                     __magic_name__ :							Optional[int]		       =							model_class(lowerCamelCase						)
                     model.to(lowerCamelCase						)
                     model.train()

                     __magic_name__ :							List[Any]		       =							self._prepare_for_class(lowerCamelCase    ,					lowerCamelCase    ,					return_labels=lowerCamelCase						)

                     if problem_type["num_labels"] > 1:
                          __magic_name__ :							Union[str, Any]		       =							inputs['''labels'''].unsqueeze(1						).repeat(1    ,					problem_type['''num_labels''']						)

                     __magic_name__ :							List[Any]		       =							inputs['''labels'''].to(problem_type['''dtype''']						)

                     # This tests that we do not trigger the warning form PyTorch "Using a target size that is different
                     # to the input size. This will likely lead to incorrect results due to broadcasting. Please ensure
                     # they have the same size." which is a symptom something in wrong for the regression problem.
                     # See https://github.com/huggingface/transformers/issues/11780
                     with warnings.catch_warnings(record=lowerCamelCase						) as warning_list:
                          __magic_name__ :							Tuple		       =							model(**lowerCamelCase						).loss
                     for w in warning_list:
                          if "Using a target size that is different to the input size" in str(w.message						):
                               raise ValueError(
                                   F'''Something is going wrong in the regression problem: intercepted {w.message}'''						)

                     loss.backward()






 @slow
 def 			lowercase				(     self						)				->       Dict:




      """simple docstring"""






      for model_name in EFFICIENTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
           __magic_name__ :							str		       =							EfficientFormerModel.from_pretrained(lowerCamelCase						)
           self.assertIsNotNone(lowerCamelCase						)






 def 			lowercase				(     self						)				->       int:




      """simple docstring"""






      __magic_name__ :							List[Any]		       =							self.model_tester.prepare_config_and_inputs_for_common()
      __magic_name__ :							Optional[Any]		       =							True

      __magic_name__ :							Union[str, Any]		       =							getattr(self.model_tester    ,					'''seq_length'''    ,					lowerCamelCase						)
      __magic_name__ :							Dict		       =							getattr(self.model_tester    ,					'''encoder_seq_length'''    ,					lowerCamelCase						)
      __magic_name__ :							Union[str, Any]		       =							getattr(self.model_tester    ,					'''key_length'''    ,					lowerCamelCase						)
      __magic_name__ :							List[Any]		       =							getattr(self.model_tester    ,					'''chunk_length'''    ,					lowerCamelCase						)

      if chunk_length is not None and hasattr(self.model_tester    ,					'''num_hashes'''						):
           __magic_name__ :							Tuple		       =							encoder_seq_length * self.model_tester.num_hashes

      for model_class in self.all_model_classes:
           __magic_name__ :							Any		       =							True
           __magic_name__ :							Any		       =							False
           __magic_name__ :							Optional[Any]		       =							True
           __magic_name__ :							List[Any]		       =							model_class(lowerCamelCase						)
           model.to(lowerCamelCase						)
           model.eval()
           with torch.no_grad():
                __magic_name__ :							Optional[Any]		       =							model(**self._prepare_for_class(lowerCamelCase    ,					lowerCamelCase						)						)
           __magic_name__ :							List[str]		       =							outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions
           self.assertEqual(len(lowerCamelCase						)    ,					self.model_tester.num_attention_outputs						)

           # check that output_attentions also work using config
           del inputs_dict["output_attentions"]
           __magic_name__ :							List[Any]		       =							True
           __magic_name__ :							Tuple		       =							model_class(lowerCamelCase						)
           model.to(lowerCamelCase						)
           model.eval()
           with torch.no_grad():
                __magic_name__ :							Any		       =							model(**self._prepare_for_class(lowerCamelCase    ,					lowerCamelCase						)						)
           __magic_name__ :							List[Any]		       =							outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions
           self.assertEqual(len(lowerCamelCase						)    ,					self.model_tester.num_attention_outputs						)

           if chunk_length is not None:
                self.assertListEqual(
                    list(attentions[0].shape[-4:]						)    ,					[self.model_tester.num_attention_heads, encoder_seq_length, chunk_length, encoder_key_length]    ,					)
           else:
                self.assertListEqual(
                    list(attentions[0].shape[-3:]						)    ,					[self.model_tester.num_attention_heads, encoder_seq_length, encoder_key_length]    ,					)







def 			lowerCAmelCase  (     )  ->Union[str, Any]:






     """simple docstring"""






     __magic_name__ :							List[Any]		       =							Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''	)
     return image





@require_torch
@require_vision
class 		A__    (       unittest.TestCase			):






 @cached_property
 def 			lowercase				(     self						)				->       Tuple:




      """simple docstring"""






      return (
          EfficientFormerImageProcessor.from_pretrained('''snap-research/efficientformer-l1-300'''						)
          if is_vision_available()
          else None
      )






 @slow
 def 			lowercase				(     self						)				->       List[Any]:




      """simple docstring"""






      __magic_name__ :							str		       =							EfficientFormerForImageClassification.from_pretrained('''snap-research/efficientformer-l1-300'''						).to(
          lowerCamelCase						)

      __magic_name__ :							Any		       =							self.default_image_processor
      __magic_name__ :							Tuple		       =							prepare_img()
      __magic_name__ :							Optional[Any]		       =							image_processor(images=lowerCamelCase    ,					return_tensors='''pt'''						).to(lowerCamelCase						)

      # forward pass
      with torch.no_grad():
           __magic_name__ :							Optional[int]		       =							model(**lowerCamelCase						)

      # verify the logits
      __magic_name__ :							str		       =							(1, 1000)
      self.assertEqual(outputs.logits.shape    ,					lowerCamelCase						)

      __magic_name__ :							str		       =							torch.tensor([-0.0_5_5_5, 0.4_8_2_5, -0.0_8_5_2]						).to(lowerCamelCase						)
      self.assertTrue(torch.allclose(outputs.logits[0][:3]    ,					lowerCamelCase    ,					atol=1e-4						)						)






 @slow
 def 			lowercase				(     self						)				->       Union[str, Any]:




      """simple docstring"""






      __magic_name__ :							List[str]		       =							EfficientFormerForImageClassificationWithTeacher.from_pretrained(
          '''snap-research/efficientformer-l1-300'''						).to(lowerCamelCase						)

      __magic_name__ :							str		       =							self.default_image_processor
      __magic_name__ :							Union[str, Any]		       =							prepare_img()
      __magic_name__ :							List[Any]		       =							image_processor(images=lowerCamelCase    ,					return_tensors='''pt'''						).to(lowerCamelCase						)

      # forward pass
      with torch.no_grad():
           __magic_name__ :							List[str]		       =							model(**lowerCamelCase						)

      # verify the logits
      __magic_name__ :							int		       =							(1, 1000)
      self.assertEqual(outputs.logits.shape    ,					lowerCamelCase						)

      __magic_name__ :							Optional[int]		       =							torch.tensor([-0.1_3_1_2, 0.4_3_5_3, -1.0_4_9_9]						).to(lowerCamelCase						)
      self.assertTrue(torch.allclose(outputs.logits[0][:3]    ,					lowerCamelCase    ,					atol=1e-4						)						)









import unittest
from pathlib import Path

from transformers import is_vision_available, load_tool
from transformers.testing_utils import get_tests_dir

from .test_tools_common import ToolTesterMixin


if is_vision_available():
				from PIL import Image





class 		A__    (       unittest.TestCase		,					__SCREAMING_SNAKE_CASE			):






	def 			lowercase				(     self						)				->       Optional[int]:




						"""simple docstring"""






						__magic_name__ :							Tuple		       =							load_tool('''image-question-answering'''						)
						self.tool.setup()
						__magic_name__ :							Any		       =							load_tool('''image-question-answering'''    ,					remote=lowerCamelCase						)






	def 			lowercase				(     self						)				->       Optional[int]:




						"""simple docstring"""






						__magic_name__ :							Dict		       =							Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''						)						) / '''000000039769.png'''						)
						__magic_name__ :							int		       =							self.tool(lowerCamelCase    ,					'''How many cats are sleeping on the couch?'''						)
						self.assertEqual(lowerCamelCase    ,					'''2'''						)






	def 			lowercase				(     self						)				->       Union[str, Any]:




						"""simple docstring"""






						__magic_name__ :							Union[str, Any]		       =							Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''						)						) / '''000000039769.png'''						)
						__magic_name__ :							int		       =							self.remote_tool(lowerCamelCase    ,					'''How many cats are sleeping on the couch?'''						)
						self.assertEqual(lowerCamelCase    ,					'''2'''						)






	def 			lowercase				(     self						)				->       Any:




						"""simple docstring"""






						__magic_name__ :							int		       =							Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''						)						) / '''000000039769.png'''						)
						__magic_name__ :							Tuple		       =							self.tool(image=lowerCamelCase    ,					question='''How many cats are sleeping on the couch?'''						)
						self.assertEqual(lowerCamelCase    ,					'''2'''						)






	def 			lowercase				(     self						)				->       Dict:




						"""simple docstring"""






						__magic_name__ :							Optional[int]		       =							Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''						)						) / '''000000039769.png'''						)
						__magic_name__ :							Tuple		       =							self.remote_tool(image=lowerCamelCase    ,					question='''How many cats are sleeping on the couch?'''						)
						self.assertEqual(lowerCamelCase    ,					'''2'''						)



