code: 
  
  
  
  
  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 						UpperCAmelCase__   (      unittest.TestCase      ,						A_		):
  
  
  
       '''simple docstring'''
  
  
  
  
       def   lowerCAmelCase_   ( self       :       List[Any]		):
  
  
  
  
  
              """simple docstring"""
  
  
  
              _lowercase					:				Optional[Any]           =			load_tool('''image-question-answering'''		)
              self.tool.setup()
              _lowercase					:				Tuple           =			load_tool('''image-question-answering'''	,      remote=UpperCamelCase		)
  
  
  
  
       def   lowerCAmelCase_   ( self       :       List[str]		):
  
  
  
  
  
              """simple docstring"""
  
  
  
              _lowercase					:				str           =			Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''		)		) / '''000000039769.png'''		)
              _lowercase					:				int           =			self.tool(UpperCamelCase	,      '''How many cats are sleeping on the couch?'''		)
              self.assertEqual(UpperCamelCase	,      '''2'''		)
  
  
  
  
       def   lowerCAmelCase_   ( self       :       List[str]		):
  
  
  
  
  
              """simple docstring"""
  
  
  
              _lowercase					:				int           =			Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''		)		) / '''000000039769.png'''		)
              _lowercase					:				List[Any]           =			self.remote_tool(UpperCamelCase	,      '''How many cats are sleeping on the couch?'''		)
              self.assertEqual(UpperCamelCase	,      '''2'''		)
  
  
  
  
       def   lowerCAmelCase_   ( self       :       int		):
  
  
  
  
  
              """simple docstring"""
  
  
  
              _lowercase					:				Optional[Any]           =			Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''		)		) / '''000000039769.png'''		)
              _lowercase					:				Tuple           =			self.tool(image=UpperCamelCase	,      question='''How many cats are sleeping on the couch?'''		)
              self.assertEqual(UpperCamelCase	,      '''2'''		)
  
  
  
  
       def   lowerCAmelCase_   ( self       :       List[str]		):
  
  
  
  
  
              """simple docstring"""
  
  
  
              _lowercase					:				Dict           =			Image.open(Path(get_tests_dir('''fixtures/tests_samples/COCO'''		)		) / '''000000039769.png'''		)
              _lowercase					:				Dict           =			self.remote_tool(image=UpperCamelCase	,      question='''How many cats are sleeping on the couch?'''		)
              self.assertEqual(UpperCamelCase	,      '''2'''		)
style_context: 
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available
  
  
  UpperCamelCase__				       =			{
      'configuration_wav2vec2_conformer': [
          'WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
          'Wav2Vec2ConformerConfig',
      ],
  }
  
  
  try:
     if not is_torch_available():
        raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
     pass
  else:
     UpperCamelCase__				       =			[
         'WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
         'Wav2Vec2ConformerForAudioFrameClassification',
         'Wav2Vec2ConformerForCTC',
         'Wav2Vec2ConformerForPreTraining',
         'Wav2Vec2ConformerForSequenceClassification',
         'Wav2Vec2ConformerForXVector',
         'Wav2Vec2ConformerModel',
         'Wav2Vec2ConformerPreTrainedModel',
     ]
  
  if TYPE_CHECKING:
     from .configuration_wavaveca_conformer import (
         WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
         WavaVecaConformerConfig,
     )
  
     try:
        if not is_torch_available():
           raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
        pass
     else:
        from .modeling_wavaveca_conformer import (
            WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
            WavaVecaConformerForAudioFrameClassification,
            WavaVecaConformerForCTC,
            WavaVecaConformerForPreTraining,
            WavaVecaConformerForSequenceClassification,
            WavaVecaConformerForXVector,
            WavaVecaConformerModel,
            WavaVecaConformerPreTrainedModel,
        )
  
  else:
     import sys
  
     UpperCamelCase__				       =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)