




import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


_lowercase		:				Tuple      		="\nHugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf originally as a company that developed a chatbot app targeted at teenagers.[2] After open-sourcing the model behind the chatbot, the company pivoted to focus on being a platform for machine learning.\n\nIn March 2021, Hugging Face raised $40 million in a Series B funding round.[3]\n\nOn April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model.[4] In 2022, the workshop concluded with the announcement of BLOOM, a multilingual large language model with 176 billion parameters.[5]\n"

class        snake_case__    (unittest.TestCase ,     __snake_case		):







						"""simple docstring"""




						def 							SCREAMING_SNAKE_CASE__(       self  ) ->				Dict:
									"""simple docstring"""




									a__       :						List[str]							=  load_tool("""text-question-answering"""  )
									self.tool.setup()
									a__       :						Tuple							=  load_tool("""text-question-answering""" ,       remote=lowerCamelCase_  )

						def 							SCREAMING_SNAKE_CASE__(       self  ) ->				str:
									"""simple docstring"""




									a__       :						str							=  self.tool(lowerCamelCase_ ,       """What did Hugging Face do in April 2021?"""  )
									self.assertEqual(lowerCamelCase_ ,       """launched the BigScience Research Workshop"""  )

						def 							SCREAMING_SNAKE_CASE__(       self  ) ->				Dict:
									"""simple docstring"""




									a__       :						List[str]							=  self.remote_tool(lowerCamelCase_ ,       """What did Hugging Face do in April 2021?"""  )
									self.assertEqual(lowerCamelCase_ ,       """launched the BigScience Research Workshop"""  )

						def 							SCREAMING_SNAKE_CASE__(       self  ) ->				Any:
									"""simple docstring"""




									a__       :						Optional[Any]							=  self.tool(text=lowerCamelCase_ ,       question="""What did Hugging Face do in April 2021?"""  )
									self.assertEqual(lowerCamelCase_ ,       """launched the BigScience Research Workshop"""  )

						def 							SCREAMING_SNAKE_CASE__(       self  ) ->				Tuple:
									"""simple docstring"""




									a__       :						List[str]							=  self.remote_tool(text=lowerCamelCase_ ,       question="""What did Hugging Face do in April 2021?"""  )
									self.assertEqual(lowerCamelCase_ ,       """launched the BigScience Research Workshop"""  )









import torch

from diffusers import StableDiffusionPipeline


_lowercase		:				Optional[int]      		="path-to-your-trained-model"
_lowercase		:				Union[str, Any]      		=StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.floataa).to("cuda")

_lowercase		:				Any      		="A photo of sks dog in a bucket"
_lowercase		:				Any      		=pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]

image.save("dog-bucket.png")




