
__magic_name__           =					'''
# Installation de Transformers
! pip install transformers datasets
# Pour installer à partir du code source au lieu de la dernière version, commentez la commande ci-dessus et décommentez la suivante.
# ! pip install git+https://github.com/huggingface/transformers.git
'''

__magic_name__           =					[{'''type''': '''code''', '''content''': INSTALL_CONTENT}]
__magic_name__           =					{
    '''{processor_class}''': '''FakeProcessorClass''',
    '''{model_class}''': '''FakeModelClass''',
    '''{object_class}''': '''FakeObjectClass''',
}





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    _SCREAMING_SNAKE_CASE					( unittest.TestCase    ,   __UpperCamelCase	):
      def A_     (     self	):
          snake_case__  =			load_tool("image-captioning"	)
          self.tool.setup()
          snake_case__  =			load_tool("image-captioning"						,		remote=lowerCamelCase	)
      def A_     (     self	):
          snake_case__  =			Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"	)	) / "000000039769.png"	)
          snake_case__  =			self.tool(lowerCamelCase	)
          self.assertEqual(lowerCamelCase						,		"two cats sleeping on a couch"	)
      def A_     (     self	):
          snake_case__  =			Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"	)	) / "000000039769.png"	)
          snake_case__  =			self.remote_tool(lowerCamelCase	)
          self.assertEqual(lowerCamelCase						,		"two cats sleeping on a couch"	)
      def A_     (     self	):
          snake_case__  =			Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"	)	) / "000000039769.png"	)
          snake_case__  =			self.tool(image=lowerCamelCase	)
          self.assertEqual(lowerCamelCase						,		"two cats sleeping on a couch"	)



      def A_     (     self	):
          snake_case__  =			Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"	)	) / "000000039769.png"	)
          snake_case__  =			self.remote_tool(image=lowerCamelCase	)
          self.assertEqual(lowerCamelCase						,		"two cats sleeping on a couch"	)



