





import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


_A					:				Any				=			"""\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			,     __SCREAMING_SNAKE_CASE    ):


    '''simple docstring'''







    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			load_tool('''text-question-answering'''     )
        self.tool.setup()
        SCREAMING_SNAKE_CASE__											=			load_tool('''text-question-answering'''   ,				remote=A_     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.tool(A_   ,				'''What did Hugging Face do in April 2021?'''     )
        self.assertEqual(A_   ,				'''launched the BigScience Research Workshop'''     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.remote_tool(A_   ,				'''What did Hugging Face do in April 2021?'''     )
        self.assertEqual(A_   ,				'''launched the BigScience Research Workshop'''     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.tool(text=A_   ,				question='''What did Hugging Face do in April 2021?'''     )
        self.assertEqual(A_   ,				'''launched the BigScience Research Workshop'''     )




    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.remote_tool(text=A_   ,				question='''What did Hugging Face do in April 2021?'''     )
        self.assertEqual(A_   ,				'''launched the BigScience Research Workshop'''     )








'''simple docstring'''
UpperCamelCase__			=      {
    "joule": 1.0,
    "kilojoule": 1000,
    "megajoule": 1000000,
    "gigajoule": 1000000000,
    "wattsecond": 1.0,
    "watthour": 3600,
    "kilowatthour": 3600000,
    "newtonmeter": 1.0,
    "calorie_nutr": 4186.8,
    "kilocalorie_nutr": 4186800.00,
    "electronvolt": 1.602176634e-19,
    "britishthermalunit_it": 1055.05585,
    "footpound": 1.35_58_18,
}




def 		__SCREAMING_SNAKE_CASE       (	_UpperCamelCase    ,		_UpperCamelCase    ,		_UpperCamelCase				):


   """simple docstring"""




   if to_type not in ENERGY_CONVERSION or from_type not in ENERGY_CONVERSION:
      lowercase_						:     Union[str, Any]							     =  (
          F"""Incorrect 'from_type' or 'to_type' value: {from_type!r}, {to_type!r}\n"""
          F"""Valid values are: {", ".join(_UpperCamelCase				)}"""
      )
      raise ValueError(_UpperCamelCase				)
   return value * ENERGY_CONVERSION[from_type] / ENERGY_CONVERSION[to_type]


if __name__ == "__main__":
 import doctest

 doctest.testmod()




