




'''simple docstring'''


from ...configuration_utils import PretrainedConfig
from ...utils import logging


_snake_case   :   Tuple     							=	logging.get_logger(__name__)

_snake_case   :   List[Any]     							=	{
    'bigcode/gpt_bigcode-santacoder': 'https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json',
}

class     A					(	_a					):
							lowercase_           =       'gpt_bigcode'
							lowercase_           =       ['past_key_values']
							lowercase_           =       {
							    'hidden_size': 'n_embd',
							    'max_position_embeddings': 'n_positions',
							    'num_attention_heads': 'n_head',
							    'num_hidden_layers': 'n_layer',
							}







							def __init__(						self :						Optional[Any]							,    lowerCAmelCase_ :						int=5_02_57							,    lowerCAmelCase_ :						Union[str, Any]=10_24							,    lowerCAmelCase_ :						Dict=7_68							,    lowerCAmelCase_ :						Tuple=12							,    lowerCAmelCase_ :						Optional[Any]=12							,    lowerCAmelCase_ :						str=None							,    lowerCAmelCase_ :						Tuple="gelu_pytorch_tanh"							,    lowerCAmelCase_ :						Dict=0.1							,    lowerCAmelCase_ :						int=0.1							,    lowerCAmelCase_ :						List[str]=0.1							,    lowerCAmelCase_ :						int=1e-5							,    lowerCAmelCase_ :						Any=0.0_2							,    lowerCAmelCase_ :						Optional[int]=True							,    lowerCAmelCase_ :						Optional[Any]=True							,    lowerCAmelCase_ :						List[Any]=5_02_56							,    lowerCAmelCase_ :						Optional[int]=5_02_56							,    lowerCAmelCase_ :						Tuple=True							,    lowerCAmelCase_ :						Union[str, Any]=True							,    lowerCAmelCase_ :						Union[str, Any]=True							,    **lowerCAmelCase_ :						List[str]							,    )    ->							Union[str, Any]:


														"""simple docstring"""


														_a			  =       vocab_size
														_a			  =       n_positions
														_a			  =       n_embd
														_a			  =       n_layer
														_a			  =       n_head
														_a			  =       n_inner
														_a			  =       activation_function
														_a			  =       resid_pdrop
														_a			  =       embd_pdrop
														_a			  =       attn_pdrop
														_a			  =       layer_norm_epsilon
														_a			  =       initializer_range
														_a			  =       scale_attn_weights
														_a			  =       use_cache
														_a			  =       attention_softmax_in_fpaa
														_a			  =       scale_attention_softmax_in_fpaa
														_a			  =       multi_query

														_a			  =       bos_token_id
														_a			  =       eos_token_id

														super().__init__(bos_token_id=lowerCAmelCase_							,    eos_token_id=lowerCAmelCase_							,    **lowerCAmelCase_      )







'''simple docstring'''


import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


_snake_case   :   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     A					(	unittest.TestCase  ,_a					):







							def      __lowerCAmelCase    (						self :						Any      )    ->							Dict:


														"""simple docstring"""


														_a			  =       load_tool('''text-question-answering'''      )
														self.tool.setup()
														_a			  =       load_tool('''text-question-answering'''							,    remote=lowerCAmelCase_      )







							def      __lowerCAmelCase    (						self :						List[Any]      )    ->							Optional[int]:


														"""simple docstring"""


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







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


														"""simple docstring"""


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







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


														"""simple docstring"""


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







							def      __lowerCAmelCase    (						self :						int      )    ->							List[Any]:


														"""simple docstring"""


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

