


'''simple docstring'''



import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


__lowercase     :						List[str]	=     '\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 							__UpperCamelCase    (		unittest.TestCase		,				lowerCAmelCase_ ):




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





						__a      :	List[str]    =  load_tool('text-question-answering'							)
						self.tool.setup()
						__a      :	List[Any]    =  load_tool('text-question-answering'						,    remote=__a							)




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





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




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





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




	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





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





	def 				__UpperCAmelCase							(       self							):

						'''simple docstring'''





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







'''simple docstring'''



from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


__lowercase     :						List[Any]	=     {
    'susnato/ernie-m-base_pytorch': 'https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json',
    'susnato/ernie-m-large_pytorch': 'https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json',
}





class 							__UpperCamelCase    (		lowerCAmelCase_ ):
	A_           =   "ernie_m"
	A_           =   {"dropout": "classifier_dropout", "num_classes": "num_labels"}




	def __init__(       self						,    __a = 25_0002						,    __a = 768						,    __a = 12						,    __a = 12						,    __a = 3072						,    __a = "gelu"						,    __a = 0.1						,    __a = 0.1						,    __a = 514						,    __a = 0.02						,    __a = 1						,    __a = 1E-0_5						,    __a=None						,    __a=False						,    __a=0.0						,    **__a						,    ):

						'''simple docstring'''





						super().__init__(pad_token_id=__a						,    **__a							)
						__a      :	int    =  vocab_size
						__a      :	Dict    =  hidden_size
						__a      :	str    =  num_hidden_layers
						__a      :	Dict    =  num_attention_heads
						__a      :	List[str]    =  intermediate_size
						__a      :	Union[str, Any]    =  hidden_act
						__a      :	List[Any]    =  hidden_dropout_prob
						__a      :	str    =  attention_probs_dropout_prob
						__a      :	Any    =  max_position_embeddings
						__a      :	int    =  initializer_range
						__a      :	Dict    =  layer_norm_eps
						__a      :	int    =  classifier_dropout
						__a      :	Dict    =  is_decoder
						__a      :	int    =  act_dropout



