
import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


lowerCamelCase__        =						"""
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		,  __magic_name__      ):






				def 				_lowerCamelCase						(		self   : Optional[Any]  ):






							'''simple docstring'''







							lowerCAmelCase__ : str   =						load_tool('summarization'  )
							self.tool.setup()
							lowerCAmelCase__ : Optional[Any]   =						load_tool('summarization'       ,	remote=a  )






				def 				_lowerCamelCase						(		self   : str  ):






							'''simple docstring'''







							lowerCAmelCase__ : int   =						self.tool(a  )
							self.assertEqual(
							    a       ,	'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 				_lowerCamelCase						(		self   : List[Any]  ):






							'''simple docstring'''







							lowerCAmelCase__ : Tuple   =						self.remote_tool(a  )
							self.assertEqual(
							    a       ,	'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 				_lowerCamelCase						(		self   : List[Any]  ):






							'''simple docstring'''







							lowerCAmelCase__ : Dict   =						self.tool(text=a  )
							self.assertEqual(
							    a       ,	'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 				_lowerCamelCase						(		self   : Any  ):






							'''simple docstring'''







							lowerCAmelCase__ : Any   =						self.remote_tool(text=a  )
							self.assertEqual(
							    a       ,	'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.'       ,	)

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier

# Load iris file
lowerCamelCase__        =						load_iris()
iris.keys()


print(F"""Target names: \n {iris.target_names} """)
print(F"""\n Features: \n {iris.feature_names}""")

# Train set e Test set
lowerCamelCase__ ,   lowerCamelCase__ ,   lowerCamelCase__ ,   lowerCamelCase__        =						train_test_split(
    iris["""data"""], iris["""target"""], random_state=4
)

# KNN

lowerCamelCase__        =						KNeighborsClassifier(n_neighbors=1)
knn.fit(X_train, y_train)

# new array to test
lowerCamelCase__        =						[[1, 2, 1, 4], [2, 3, 4, 5]]

lowerCamelCase__        =						knn.predict(X_new)

print(
    F"""\nNew array: \n {X_new}\n\nTarget Names Prediction: \n"""
    F""" {iris["target_names"][prediction]}"""
)