




"""simple docstring"""


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


A_						=				logging.get_logger(__name__)

A_						=				{
    '''facebook/xglm-564M''': '''https://huggingface.co/facebook/xglm-564M/resolve/main/config.json''',
    # See all XGLM models at https://huggingface.co/models?filter=xglm
}






class 					lowercase(     __a ):







 '''simple docstring'''





 lowercase__ 					=					"xglm"
 lowercase__ 					=					["past_key_values"]

 lowercase__ 					=					{
     "num_attention_heads": "attention_heads",
     "hidden_size": "d_model",
     "num_hidden_layers": "num_layers",
 }


 def __init__(				self:		Dict,      a_:		int=256_008,      a_:		List[str]=2_048,      a_:		Dict=1_024,      a_:		int=4_096,      a_:		List[Any]=24,      a_:		Any=16,      a_:		Dict="gelu",      a_:		Optional[Any]=0.1,      a_:		str=0.1,      a_:		Union[str, Any]=0.0,      a_:		List[str]=0.0,      a_:		List[Any]=0.02,      a_:		Dict=True,      a_:		int=True,      a_:		List[Any]=2,      a_:		str=1,      a_:		Optional[int]=0,      a_:		Tuple=2,      **a_:		Tuple,      ):




   '''simple docstring'''



   _snake_case							:		Union[str, Any]								=  vocab_size
   _snake_case							:		Optional[int]								=  max_position_embeddings
   _snake_case							:		Union[str, Any]								=  d_model
   _snake_case							:		Optional[int]								=  ffn_dim
   _snake_case							:		List[Any]								=  num_layers
   _snake_case							:		int								=  attention_heads
   _snake_case							:		int								=  activation_function
   _snake_case							:		List[str]								=  dropout
   _snake_case							:		List[Any]								=  attention_dropout
   _snake_case							:		Any								=  activation_dropout
   _snake_case							:		Union[str, Any]								=  layerdrop
   _snake_case							:		int								=  init_std
   _snake_case							:		Optional[Any]								=  scale_embedding  # scale factor will be sqrt(d_model) if True
   _snake_case							:		Union[str, Any]								=  use_cache

   super().__init__(
       pad_token_id=a_,      bos_token_id=a_,      eos_token_id=a_,      decoder_start_token_id=a_,      **a_,      )




"""simple docstring"""




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 		a__						(      unittest.TestCase,			a_						):
   def 			__magic_name__			(			self				):
          lowercase    :				Tuple       		=							load_tool("text-question-answering"				)
          self.tool.setup()
          lowercase    :				Dict       		=							load_tool("text-question-answering"	,    remote=_a				)
   def 			__magic_name__			(			self				):
          lowercase    :				str       		=							self.tool(_a	,    "What did Hugging Face do in April 2021?"				)
          self.assertEqual(_a	,    "launched the BigScience Research Workshop"				)
   def 			__magic_name__			(			self				):
          lowercase    :				Union[str, Any]       		=							self.remote_tool(_a	,    "What did Hugging Face do in April 2021?"				)
          self.assertEqual(_a	,    "launched the BigScience Research Workshop"				)
   def 			__magic_name__			(			self				):
          lowercase    :				int       		=							self.tool(text=_a	,    question="What did Hugging Face do in April 2021?"				)
          self.assertEqual(_a	,    "launched the BigScience Research Workshop"				)

   def 			__magic_name__			(			self				):
          lowercase    :				Optional[Any]       		=							self.remote_tool(text=_a	,    question="What did Hugging Face do in April 2021?"				)
          self.assertEqual(_a	,    "launched the BigScience Research Workshop"				)


