



import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


snake_case_         = """
Hugging 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.

In March 2021, Hugging Face raised $40 million in a Series B funding round.[3]

On 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]
"""







class    A_    (  unittest.TestCase			,     SCREAMING_SNAKE_CASE_       ):



						"""simple docstring"""






						def 			UpperCAmelCase__  (      self				:Dict      )       ->    List[Any]:
												UpperCAmelCase    =				load_tool('summarization'      )
												self.tool.setup()
												UpperCAmelCase    =				load_tool('summarization'     ,						remote=lowercase_      )






						def 			UpperCAmelCase__  (      self				:List[str]      )       ->    Tuple:
												UpperCAmelCase    =				self.tool(lowercase_      )
												self.assertEqual(
												    lowercase_     ,						'Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model. In 2022, the workshop concluded with the announcement of BLOOM.'     ,						)






						def 			UpperCAmelCase__  (      self				:List[Any]      )       ->    int:
												UpperCAmelCase    =				self.remote_tool(lowercase_      )
												self.assertEqual(
												    lowercase_     ,						'Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model. In 2022, the workshop concluded with the announcement of BLOOM.'     ,						)






						def 			UpperCAmelCase__  (      self				:Optional[Any]      )       ->    Optional[int]:
												UpperCAmelCase    =				self.tool(text=lowercase_      )
												self.assertEqual(
												    lowercase_     ,						'Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model. In 2022, the workshop concluded with the announcement of BLOOM.'     ,						)






						def 			UpperCAmelCase__  (      self				:Optional[int]      )       ->    Tuple:
												UpperCAmelCase    =				self.remote_tool(text=lowercase_      )
												self.assertEqual(
												    lowercase_     ,						'Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model. In 2022, the workshop concluded with the announcement of BLOOM.'     ,						)










"""simple docstring"""


from dataclasses import dataclass
from typing import Callable, Optional

import datasets







@dataclass
class    A_    (  datasets.BuilderConfig       ):



						"""simple docstring"""
						__UpperCamelCase	       =							None
						__UpperCamelCase	       =							None
						__UpperCamelCase	       =							None






						def 			UpperCAmelCase__  (      self				:str      )       ->    Optional[Any]:
												assert self.generator is not None, "generator must be specified"

												if self.gen_kwargs is None:
																		UpperCAmelCase    =				{}







class    A_    (  datasets.GeneratorBasedBuilder       ):



						"""simple docstring"""
						__UpperCamelCase	       =							GeneratorConfig






						def 			UpperCAmelCase__  (      self				:Union[str, Any]      )       ->    str:
												return datasets.DatasetInfo(features=self.config.features      )






						def 			UpperCAmelCase__  (      self				:List[Any]     ,						lowercase_				:List[Any]      )       ->    Union[str, Any]:
												return [datasets.SplitGenerator(name=datasets.Split.TRAIN     ,						gen_kwargs=self.config.gen_kwargs      )]






						def 			UpperCAmelCase__  (      self				:Optional[int]     ,						**lowercase_				:Dict      )       ->    str:
												for idx, ex in enumerate(self.config.generator(**lowercase_      )      ):
																		yield idx, ex





