






import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


__a:     int   					=					'''
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 		SCREAMING_SNAKE_CASE__	(  unittest.TestCase					,      UpperCAmelCase     ):

  '''simple docstring'''







  def  lowerCamelCase       (      self		:			Union[str, Any]							)						->	str:


         """simple docstring"""
         _UpperCAmelCase							=    load_tool("""text-question-answering"""							)
         self.tool.setup()
         _UpperCAmelCase							=    load_tool("""text-question-answering"""       ,				remote=lowerCamelCase							)


  def  lowerCamelCase       (      self		:			str							)						->	List[str]:


         """simple docstring"""
         _UpperCAmelCase							=    self.tool(lowerCamelCase       ,				"""What did Hugging Face do in April 2021?"""							)
         self.assertEqual(lowerCamelCase       ,				"""launched the BigScience Research Workshop"""							)


  def  lowerCamelCase       (      self		:			Optional[Any]							)						->	List[str]:


         """simple docstring"""
         _UpperCAmelCase							=    self.remote_tool(lowerCamelCase       ,				"""What did Hugging Face do in April 2021?"""							)
         self.assertEqual(lowerCamelCase       ,				"""launched the BigScience Research Workshop"""							)


  def  lowerCamelCase       (      self		:			Any							)						->	str:


         """simple docstring"""
         _UpperCAmelCase							=    self.tool(text=lowerCamelCase       ,				question="""What did Hugging Face do in April 2021?"""							)
         self.assertEqual(lowerCamelCase       ,				"""launched the BigScience Research Workshop"""							)





  def  lowerCamelCase       (      self		:			List[str]							)						->	Optional[int]:


         """simple docstring"""
         _UpperCAmelCase							=    self.remote_tool(text=lowerCamelCase       ,				question="""What did Hugging Face do in April 2021?"""							)
         self.assertEqual(lowerCamelCase       ,				"""launched the BigScience Research Workshop"""							)







import os
import sys

__a:     Union[str, Any]   					=					os.path.join(os.path.dirname(__file__), '''src''')
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


__a:     Union[str, Any]   					=					[
    '''torch''',
    '''numpy''',
    '''tokenizers''',
    '''filelock''',
    '''requests''',
    '''tqdm''',
    '''regex''',
    '''sentencepiece''',
    '''sacremoses''',
    '''importlib_metadata''',
    '''huggingface_hub''',
]




@add_start_docstrings(AutoConfig.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Union[str, Any]:
       return AutoConfig.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoTokenizer.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Any:
       return AutoTokenizer.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoModel.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Tuple:
       return AutoModel.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoModelForCausalLM.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Tuple:
       return AutoModelForCausalLM.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoModelForMaskedLM.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						Optional[Any]:
       return AutoModelForMaskedLM.from_pretrained(*__snake_case   ,      **__snake_case )




@add_start_docstrings(AutoModelForSequenceClassification.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						List[str]:
       return AutoModelForSequenceClassification.from_pretrained(*__snake_case   ,      **__snake_case )





@add_start_docstrings(AutoModelForQuestionAnswering.__doc__ )
def       _SCREAMING_SNAKE_CASE (							*__snake_case   ,      **__snake_case )				->						List[Any]:
       return AutoModelForQuestionAnswering.from_pretrained(*__snake_case   ,      **__snake_case )