
import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


lowercase  : str						   =							'''
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 __snake_case		(				unittest.TestCase ,     lowerCamelCase__					):
    def 				_SCREAMING_SNAKE_CASE	(  self				):



           '''simple docstring'''







           lowercase							:					Optional[int]	     =				load_tool("""text-question-answering"""				)
           self.tool.setup()
           lowercase							:					Any	     =				load_tool("""text-question-answering"""		,remote=snake_case				)
    def 				_SCREAMING_SNAKE_CASE	(  self				):



           '''simple docstring'''







           lowercase							:					List[Any]	     =				self.tool(snake_case		,"""What did Hugging Face do in April 2021?"""				)
           self.assertEqual(snake_case		,"""launched the BigScience Research Workshop"""				)
    def 				_SCREAMING_SNAKE_CASE	(  self				):



           '''simple docstring'''







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



           '''simple docstring'''







           lowercase							:					Any	     =				self.tool(text=snake_case		,question="""What did Hugging Face do in April 2021?"""				)
           self.assertEqual(snake_case		,"""launched the BigScience Research Workshop"""				)
    def 				_SCREAMING_SNAKE_CASE	(  self				):



           '''simple docstring'''







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




from bisect import bisect
from itertools import accumulate







def 						_snake_case(  SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    )			->   Optional[int]:
       lowercase							:					Dict	     =				sorted(zip(SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    ) ,     key=lambda SCREAMING_SNAKE_CASE__    : x[0] / x[1] ,     reverse=SCREAMING_SNAKE_CASE__    )
       lowercase     ,      lowercase							:					Optional[Any]	     =				[i[0] for i in r], [i[1] for i in r]
       lowercase							:					Any	     =				list(accumulate(SCREAMING_SNAKE_CASE__    )    )
       lowercase							:					int	     =				bisect(SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    )
       return (
           0
           if k == 0
           else sum(vl[:k]    ) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
           if k != n
           else sum(vl[:k]    )
       )


if __name__ == "__main__":
  import doctest

  doctest.testmod()
