


import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


__UpperCAmelCase					       =							'''
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       ,       a__						):





							'''simple docstring'''






							def 						__SCREAMING_SNAKE_CASE							(	self     ) ->							Union[str, Any]:
														lowerCAmelCase__      =			load_tool('''text-question-answering'''     )
														self.tool.setup()
														lowerCAmelCase__      =			load_tool('''text-question-answering'''      ,					remote=lowerCamelCase_     )







							def 						__SCREAMING_SNAKE_CASE							(	self     ) ->							Optional[Any]:
														lowerCAmelCase__      =			self.tool(lowerCamelCase_      ,					'''What did Hugging Face do in April 2021?'''     )
														self.assertEqual(lowerCamelCase_      ,					'''launched the BigScience Research Workshop'''     )







							def 						__SCREAMING_SNAKE_CASE							(	self     ) ->							str:
														lowerCAmelCase__      =			self.remote_tool(lowerCamelCase_      ,					'''What did Hugging Face do in April 2021?'''     )
														self.assertEqual(lowerCamelCase_      ,					'''launched the BigScience Research Workshop'''     )







							def 						__SCREAMING_SNAKE_CASE							(	self     ) ->							List[str]:
														lowerCAmelCase__      =			self.tool(text=lowerCamelCase_      ,					question='''What did Hugging Face do in April 2021?'''     )
														self.assertEqual(lowerCamelCase_      ,					'''launched the BigScience Research Workshop'''     )







							def 						__SCREAMING_SNAKE_CASE							(	self     ) ->							Optional[int]:
														lowerCAmelCase__      =			self.remote_tool(text=lowerCamelCase_      ,					question='''What did Hugging Face do in April 2021?'''     )
														self.assertEqual(lowerCamelCase_      ,					'''launched the BigScience Research Workshop'''     )



'''simple docstring'''






import jax.numpy as jnp

from ...utils import logging
from ..ta.modeling_flax_ta import FlaxTaEncoderModel, FlaxTaForConditionalGeneration, FlaxTaModel
from .configuration_mta import MTaConfig


__UpperCAmelCase					       =							logging.get_logger(__name__)

__UpperCAmelCase					       =							'''T5Config'''


def       _snake_case     (  A				,					A				,					A )		->					jnp.ndarray:
							lowerCAmelCase__      =			jnp.zeros_like(A )
							lowerCAmelCase__      =			shifted_input_ids.at[:, 1:].set(input_ids[:, :-1] )
							lowerCAmelCase__      =			shifted_input_ids.at[:, 0].set(A )

							lowerCAmelCase__      =			jnp.where(shifted_input_ids == -100				,					A				,					A )
							return shifted_input_ids




class 	a__       (							a__						):





							'''simple docstring'''






							lowercase__    :     int					=   "mt5"
							lowercase__    :     Dict					=   MTaConfig




class 	a__       (							a__						):





							'''simple docstring'''






							lowercase__    :     int					=   "mt5"
							lowercase__    :     Any					=   MTaConfig




class 	a__       (							a__						):





							'''simple docstring'''






							lowercase__    :     Union[str, Any]					=   "mt5"
							lowercase__    :     Tuple					=   MTaConfig