




import unittest

from datasets import load_dataset

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


class 				__UpperCamelCase      (			unittest.TestCase  ,       a__	):





				'''simple docstring'''



				def    __snake_case		(			self    ):
											lowerCAmelCase =		load_tool('''document-question-answering'''    )
											self.tool.setup()
											lowerCAmelCase =		load_tool('''document-question-answering'''							,			remote=__UpperCAmelCase    )



				def    __snake_case		(			self    ):
											lowerCAmelCase =		load_dataset('''hf-internal-testing/example-documents'''							,			split='''test'''    )
											lowerCAmelCase =		dataset[0]['''image''']

											lowerCAmelCase =		self.tool(__UpperCAmelCase							,			'''When is the coffee break?'''    )
											self.assertEqual(__UpperCAmelCase							,			'''11-14 to 11:39 a.m.'''    )



				def    __snake_case		(			self    ):
											lowerCAmelCase =		load_dataset('''hf-internal-testing/example-documents'''							,			split='''test'''    )
											lowerCAmelCase =		dataset[0]['''image''']

											lowerCAmelCase =		self.remote_tool(__UpperCAmelCase							,			'''When is the coffee break?'''    )
											self.assertEqual(__UpperCAmelCase							,			'''11-14 to 11:39 a.m.'''    )



				def    __snake_case		(			self    ):
											lowerCAmelCase =		load_dataset('''hf-internal-testing/example-documents'''							,			split='''test'''    )
											lowerCAmelCase =		dataset[0]['''image''']

											self.tool(document=__UpperCAmelCase							,			question='''When is the coffee break?'''    )






				def    __snake_case		(			self    ):
											lowerCAmelCase =		load_dataset('''hf-internal-testing/example-documents'''							,			split='''test'''    )
											lowerCAmelCase =		dataset[0]['''image''']

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







"""simple docstring"""






def    A_ ( _lowerCAmelCase  :       str							):






     """simple docstring"""

     return "".join(chr(ord(_lowerCAmelCase							) + 32							) if '''A''' <= char <= '''Z''' else char for char in word							)


if __name__ == "__main__":
   from doctest import testmod

   testmod()