



'''simple docstring'''
import unittest

from datasets import load_dataset

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


class   SCREAMING_SNAKE_CASE__				(   unittest.TestCase     ,			lowerCamelCase_					):
 """simple docstring"""


 def      a__ (		self			) ->							Dict:
    A:      Tuple														=   load_tool("""document-question-answering"""			)
    self.tool.setup()
    A:      Tuple														=   load_tool("""document-question-answering"""					,   remote=A			)


 def      a__ (		self			) ->							Any:
    A:      List[Any]														=   load_dataset("""hf-internal-testing/example-documents"""					,   split="""test"""			)
    A:      List[Any]														=   dataset[0]["image"]

    A:      Optional[Any]														=   self.tool(A					,   """When is the coffee break?"""			)
    self.assertEqual(A					,   """11-14 to 11:39 a.m."""			)


 def      a__ (		self			) ->							Dict:
    A:      Dict														=   load_dataset("""hf-internal-testing/example-documents"""					,   split="""test"""			)
    A:      str														=   dataset[0]["image"]

    A:      Optional[int]														=   self.remote_tool(A					,   """When is the coffee break?"""			)
    self.assertEqual(A					,   """11-14 to 11:39 a.m."""			)


 def      a__ (		self			) ->							Optional[int]:
    A:      Dict														=   load_dataset("""hf-internal-testing/example-documents"""					,   split="""test"""			)
    A:      List[Any]														=   dataset[0]["image"]

    self.tool(document=A					,   question="""When is the coffee break?"""			)





 def      a__ (		self			) ->							List[Any]:
    A:      Optional[Any]														=   load_dataset("""hf-internal-testing/example-documents"""					,   split="""test"""			)
    A:      int														=   dataset[0]["image"]

    A:      Dict														=   self.remote_tool(document=A					,   question="""When is the coffee break?"""			)
    self.assertEqual(A					,   """11-14 to 11:39 a.m."""			)










'''simple docstring'''
from ..utils import DummyObject, requires_backends


class   SCREAMING_SNAKE_CASE__				(   metaclass=snake_case_					):
	"""simple docstring"""


	A__    :    Optional[int]						=				['''torch''', '''transformers''', '''invisible_watermark''']


	def __init__(		self					,   *A					,   **A			) ->							Tuple:
				requires_backends(self					,   ["""torch""", """transformers""", """invisible_watermark"""]			)


	@classmethod
	def      a__ (		cls					,   *A					,   **A			) ->							Optional[int]:
				requires_backends(cls					,   ["""torch""", """transformers""", """invisible_watermark"""]			)





	@classmethod
	def      a__ (		cls					,   *A					,   **A			) ->							List[Any]:
				requires_backends(cls					,   ["""torch""", """transformers""", """invisible_watermark"""]			)







class   SCREAMING_SNAKE_CASE__				(   metaclass=snake_case_					):
	"""simple docstring"""


	A__    :    Optional[int]						=				['''torch''', '''transformers''', '''invisible_watermark''']


	def __init__(		self					,   *A					,   **A			) ->							List[str]:
				requires_backends(self					,   ["""torch""", """transformers""", """invisible_watermark"""]			)


	@classmethod
	def      a__ (		cls					,   *A					,   **A			) ->							Union[str, Any]:
				requires_backends(cls					,   ["""torch""", """transformers""", """invisible_watermark"""]			)





	@classmethod
	def      a__ (		cls					,   *A					,   **A			) ->							Union[str, Any]:
				requires_backends(cls					,   ["""torch""", """transformers""", """invisible_watermark"""]			)





