from ...utils import is_transformers_available
from .pipeline_latent_diffusion_superresolution import LDMSuperResolutionPipeline


if is_transformers_available():
     from .pipeline_latent_diffusion import LDMBertModel, LDMTextToImagePipeline

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		):







   def 	lowerCamelCase_  (    self	:	Optional[Any]							):





    """simple docstring"""


    UpperCamelCase      =			load_tool("""document-question-answering"""							)
    self.tool.setup()
    UpperCamelCase      =			load_tool("""document-question-answering"""      ,      remote=lowerCamelCase_							)







   def 	lowerCamelCase_  (    self	:	Optional[Any]							):





    """simple docstring"""


    UpperCamelCase      =			load_dataset("""hf-internal-testing/example-documents"""      ,      split="""test"""							)
    UpperCamelCase      =			dataset[0]["""image"""]

    UpperCamelCase      =			self.tool(lowerCamelCase_      ,      """When is the coffee break?"""							)
    self.assertEqual(lowerCamelCase_      ,      """11-14 to 11:39 a.m."""							)







   def 	lowerCamelCase_  (    self	:	Union[str, Any]							):





    """simple docstring"""


    UpperCamelCase      =			load_dataset("""hf-internal-testing/example-documents"""      ,      split="""test"""							)
    UpperCamelCase      =			dataset[0]["""image"""]

    UpperCamelCase      =			self.remote_tool(lowerCamelCase_      ,      """When is the coffee break?"""							)
    self.assertEqual(lowerCamelCase_      ,      """11-14 to 11:39 a.m."""							)







   def 	lowerCamelCase_  (    self	:	int							):





    """simple docstring"""


    UpperCamelCase      =			load_dataset("""hf-internal-testing/example-documents"""      ,      split="""test"""							)
    UpperCamelCase      =			dataset[0]["""image"""]

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







   def 	lowerCamelCase_  (    self	:	Any							):





    """simple docstring"""


    UpperCamelCase      =			load_dataset("""hf-internal-testing/example-documents"""      ,      split="""test"""							)
    UpperCamelCase      =			dataset[0]["""image"""]

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