





"""simple docstring"""



import unittest

from transformers import FunnelConfig, FunnelTokenizer, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
       import torch

       from transformers import (
           MODEL_FOR_PRETRAINING_MAPPING,
           FunnelBaseModel,
           FunnelForMaskedLM,
           FunnelForMultipleChoice,
           FunnelForPreTraining,
           FunnelForQuestionAnswering,
           FunnelForSequenceClassification,
           FunnelForTokenClassification,
           FunnelModel,
       )






class 	__snake_case      :





 """simple docstring"""


 def __init__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase=13      ,		__lowerCamelCase=7      ,		__lowerCamelCase=True      ,		__lowerCamelCase=True      ,		__lowerCamelCase=True      ,		__lowerCamelCase=True      ,		__lowerCamelCase=99      ,		__lowerCamelCase=[1, 1, 2]      ,		__lowerCamelCase=1      ,		__lowerCamelCase=32      ,		__lowerCamelCase=4      ,		__lowerCamelCase=8      ,		__lowerCamelCase=37      ,		__lowerCamelCase="gelu_new"      ,		__lowerCamelCase=0.1      ,		__lowerCamelCase=0.1      ,		__lowerCamelCase=0.0      ,		__lowerCamelCase=512      ,		__lowerCamelCase=3      ,		__lowerCamelCase=0.0_2      ,		__lowerCamelCase=3      ,		__lowerCamelCase=4      ,		__lowerCamelCase=None      ,		__lowerCamelCase=False      ,		):



     '''simple docstring'''




     __A					:		Any						=  parent
     __A					:		List[str]						=  batch_size
     __A					:		List[str]						=  seq_length
     __A					:		Dict						=  is_training
     __A					:		str						=  use_input_mask
     __A					:		Tuple						=  use_token_type_ids
     __A					:		Dict						=  use_labels
     __A					:		Optional[Any]						=  vocab_size
     __A					:		Any						=  block_sizes
     __A					:		int						=  num_decoder_layers
     __A					:		Any						=  d_model
     __A					:		Tuple						=  n_head
     __A					:		int						=  d_head
     __A					:		int						=  d_inner
     __A					:		Any						=  hidden_act
     __A					:		List[str]						=  hidden_dropout
     __A					:		int						=  attention_dropout
     __A					:		List[str]						=  activation_dropout
     __A					:		str						=  max_position_embeddings
     __A					:		int						=  type_vocab_size
     __A					:		Dict						=  2
     __A					:		Optional[Any]						=  num_labels
     __A					:		List[str]						=  num_choices
     __A					:		Dict						=  scope
     __A					:		int						=  initializer_std

     # Used in the tests to check the size of the first attention layer
     __A					:		str						=  n_head
     # Used in the tests to check the size of the first hidden state
     __A					:		Optional[int]						=  self.d_model
     # Used in the tests to check the number of output hidden states/attentions
     __A					:		List[Any]						=  sum(self.block_sizes						) + (0 if base else self.num_decoder_layers)
     # FunnelModel adds two hidden layers: input embeddings and the sum of the upsampled encoder hidden state with
     # the last hidden state of the first block (which is the first hidden state of the decoder).
     if not base:
         __A					:		Tuple						=  self.num_hidden_layers + 2

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Optional[int]						=  ids_tensor([self.batch_size, self.seq_length]      ,		self.vocab_size						)

     __A					:		Any						=  None
     if self.use_input_mask:
         __A					:		str						=  ids_tensor([self.batch_size, self.seq_length]      ,		vocab_size=2						)

     __A					:		Union[str, Any]						=  None
     if self.use_token_type_ids:
         __A					:		int						=  ids_tensor([self.batch_size, self.seq_length]      ,		self.type_vocab_size						)

     __A					:		str						=  None
     __A					:		Union[str, Any]						=  None
     __A					:		List[Any]						=  None
     if self.use_labels:
         __A					:		str						=  ids_tensor([self.batch_size]      ,		self.type_sequence_label_size						)
         __A					:		str						=  ids_tensor([self.batch_size, self.seq_length]      ,		self.num_labels						)
         __A					:		Optional[int]						=  ids_tensor([self.batch_size]      ,		self.num_choices						)
         __A					:		Optional[int]						=  ids_tensor([self.batch_size, self.seq_length]      ,		1						)

     __A					:		str						=  self.get_config()

     return (
         config,
         input_ids,
         token_type_ids,
         input_mask,
         sequence_labels,
         token_labels,
         choice_labels,
         fake_token_labels,
     )

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     return FunnelConfig(
         vocab_size=self.vocab_size      ,		block_sizes=self.block_sizes      ,		num_decoder_layers=self.num_decoder_layers      ,		d_model=self.d_model      ,		n_head=self.n_head      ,		d_head=self.d_head      ,		d_inner=self.d_inner      ,		hidden_act=self.hidden_act      ,		hidden_dropout=self.hidden_dropout      ,		attention_dropout=self.attention_dropout      ,		activation_dropout=self.activation_dropout      ,		max_position_embeddings=self.max_position_embeddings      ,		type_vocab_size=self.type_vocab_size      ,		initializer_std=self.initializer_std      ,		)

 def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		):



     '''simple docstring'''




     __A					:		Optional[Any]						=  FunnelModel(config=__lowerCamelCase						)
     model.to(__lowerCamelCase						)
     model.eval()
     __A					:		Optional[int]						=  model(__lowerCamelCase      ,		attention_mask=__lowerCamelCase      ,		token_type_ids=__lowerCamelCase						)
     __A					:		List[Any]						=  model(__lowerCamelCase      ,		token_type_ids=__lowerCamelCase						)
     __A					:		Tuple						=  model(__lowerCamelCase						)
     self.parent.assertEqual(result.last_hidden_state.shape      ,		(self.batch_size, self.seq_length, self.d_model)						)

     __A					:		Dict						=  False
     __A					:		List[str]						=  model(__lowerCamelCase						)
     self.parent.assertEqual(result.last_hidden_state.shape      ,		(self.batch_size, self.seq_length, self.d_model)						)

     __A					:		Dict						=  False
     __A					:		Union[str, Any]						=  model(__lowerCamelCase						)
     self.parent.assertEqual(result.last_hidden_state.shape      ,		(self.batch_size, self.seq_length, self.d_model)						)

 def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		):



     '''simple docstring'''




     __A					:		List[str]						=  FunnelBaseModel(config=__lowerCamelCase						)
     model.to(__lowerCamelCase						)
     model.eval()
     __A					:		int						=  model(__lowerCamelCase      ,		attention_mask=__lowerCamelCase      ,		token_type_ids=__lowerCamelCase						)
     __A					:		List[Any]						=  model(__lowerCamelCase      ,		token_type_ids=__lowerCamelCase						)
     __A					:		Dict						=  model(__lowerCamelCase						)
     self.parent.assertEqual(result.last_hidden_state.shape      ,		(self.batch_size, 2, self.d_model)						)

     __A					:		str						=  False
     __A					:		List[Any]						=  model(__lowerCamelCase						)
     self.parent.assertEqual(result.last_hidden_state.shape      ,		(self.batch_size, 3, self.d_model)						)

     __A					:		int						=  False
     __A					:		Any						=  model(__lowerCamelCase						)
     self.parent.assertEqual(result.last_hidden_state.shape      ,		(self.batch_size, 2, self.d_model)						)

 def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		):



     '''simple docstring'''




     __A					:		Union[str, Any]						=  self.num_labels
     __A					:		Optional[int]						=  FunnelForPreTraining(config=__lowerCamelCase						)
     model.to(__lowerCamelCase						)
     model.eval()
     __A					:		Any						=  model(__lowerCamelCase      ,		attention_mask=__lowerCamelCase      ,		token_type_ids=__lowerCamelCase      ,		labels=__lowerCamelCase						)
     self.parent.assertEqual(result.logits.shape      ,		(self.batch_size, self.seq_length)						)

 def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		):



     '''simple docstring'''




     __A					:		Dict						=  FunnelForMaskedLM(config=__lowerCamelCase						)
     model.to(__lowerCamelCase						)
     model.eval()
     __A					:		List[str]						=  model(__lowerCamelCase      ,		attention_mask=__lowerCamelCase      ,		token_type_ids=__lowerCamelCase      ,		labels=__lowerCamelCase						)
     self.parent.assertEqual(result.logits.shape      ,		(self.batch_size, self.seq_length, self.vocab_size)						)

 def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		):



     '''simple docstring'''




     __A					:		Tuple						=  self.num_labels
     __A					:		Tuple						=  FunnelForSequenceClassification(__lowerCamelCase						)
     model.to(__lowerCamelCase						)
     model.eval()
     __A					:		Any						=  model(__lowerCamelCase      ,		attention_mask=__lowerCamelCase      ,		token_type_ids=__lowerCamelCase      ,		labels=__lowerCamelCase						)
     self.parent.assertEqual(result.logits.shape      ,		(self.batch_size, self.num_labels)						)

 def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		):



     '''simple docstring'''




     __A					:		List[str]						=  self.num_choices
     __A					:		Tuple						=  FunnelForMultipleChoice(config=__lowerCamelCase						)
     model.to(__lowerCamelCase						)
     model.eval()
     __A					:		List[Any]						=  input_ids.unsqueeze(1						).expand(-1      ,		self.num_choices      ,		-1						).contiguous()
     __A					:		Tuple						=  token_type_ids.unsqueeze(1						).expand(-1      ,		self.num_choices      ,		-1						).contiguous()
     __A					:		Optional[Any]						=  input_mask.unsqueeze(1						).expand(-1      ,		self.num_choices      ,		-1						).contiguous()
     __A					:		List[Any]						=  model(
         __lowerCamelCase      ,		attention_mask=__lowerCamelCase      ,		token_type_ids=__lowerCamelCase      ,		labels=__lowerCamelCase      ,		)
     self.parent.assertEqual(result.logits.shape      ,		(self.batch_size, self.num_choices)						)

 def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		):



     '''simple docstring'''




     __A					:		Any						=  self.num_labels
     __A					:		Union[str, Any]						=  FunnelForTokenClassification(config=__lowerCamelCase						)
     model.to(__lowerCamelCase						)
     model.eval()
     __A					:		Optional[Any]						=  model(__lowerCamelCase      ,		attention_mask=__lowerCamelCase      ,		token_type_ids=__lowerCamelCase      ,		labels=__lowerCamelCase						)
     self.parent.assertEqual(result.logits.shape      ,		(self.batch_size, self.seq_length, self.num_labels)						)

 def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		):



     '''simple docstring'''




     __A					:		Optional[Any]						=  FunnelForQuestionAnswering(config=__lowerCamelCase						)
     model.to(__lowerCamelCase						)
     model.eval()
     __A					:		Dict						=  model(
         __lowerCamelCase      ,		attention_mask=__lowerCamelCase      ,		token_type_ids=__lowerCamelCase      ,		start_positions=__lowerCamelCase      ,		end_positions=__lowerCamelCase      ,		)
     self.parent.assertEqual(result.start_logits.shape      ,		(self.batch_size, self.seq_length)						)
     self.parent.assertEqual(result.end_logits.shape      ,		(self.batch_size, self.seq_length)						)







 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Optional[Any]						=  self.prepare_config_and_inputs()
     (
         (
         __A
     )				, (
         __A
     )				, (
         __A
     )				, (
         __A
     )				, (
         __A
     )				, (
         __A
     )				, (
         __A
     )				, (
         __A
     )				, 
     )					:		int						=  config_and_inputs
     __A					:		Union[str, Any]						=  {'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
     return config, inputs_dict






@require_torch
class 	__snake_case      (	SCREAMING_SNAKE_CASE__							,							SCREAMING_SNAKE_CASE__							,							unittest.TestCase  ):





 """simple docstring"""


 _lowerCamelCase				 =  False
 _lowerCamelCase				 =  False
 _lowerCamelCase				 =  (
     (
         FunnelModel,
         FunnelForMaskedLM,
         FunnelForPreTraining,
         FunnelForQuestionAnswering,
         FunnelForTokenClassification,
     )
     if is_torch_available()
     else ()
 )
 _lowerCamelCase				 =  (
     {
         """feature-extraction""": (FunnelBaseModel, FunnelModel),
         """fill-mask""": FunnelForMaskedLM,
         """question-answering""": FunnelForQuestionAnswering,
         """text-classification""": FunnelForSequenceClassification,
         """token-classification""": FunnelForTokenClassification,
         """zero-shot""": FunnelForSequenceClassification,
     }
     if is_torch_available()
     else {}
 )

 def       UpperCamelCase__(					self      ,		__lowerCamelCase      ,		__lowerCamelCase      ,		__lowerCamelCase=False						):



     '''simple docstring'''




     __A					:		Optional[int]						=  super()._prepare_for_class(__lowerCamelCase      ,		__lowerCamelCase      ,		return_labels=__lowerCamelCase						)

     if return_labels:
         if model_class in get_values(__lowerCamelCase						):
             __A					:		Tuple						=  torch.zeros(
                 (self.model_tester.batch_size, self.model_tester.seq_length)      ,		dtype=torch.long      ,		device=__lowerCamelCase						)
     return inputs_dict

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Tuple						=  FunnelModelTester(self						)
     __A					:		List[Any]						=  ConfigTester(self      ,		config_class=__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     self.config_tester.run_common_tests()

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Optional[int]						=  self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_model(*__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Optional[int]						=  self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_for_pretraining(*__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Tuple						=  self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_for_masked_lm(*__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		List[Any]						=  self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_for_token_classification(*__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		int						=  self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_for_question_answering(*__lowerCamelCase						)







 def       UpperCamelCase__(					self      ,		__lowerCamelCase						):



     '''simple docstring'''




     if hasattr(__lowerCamelCase      ,		'''weight'''						) and module.weight is not None:
         module.weight.data.fill_(3						)
     if hasattr(__lowerCamelCase      ,		'''bias'''						) and module.bias is not None:
         module.bias.data.fill_(3						)

     for param in ["r_w_bias", "r_r_bias", "r_kernel", "r_s_bias", "seg_embed"]:
         if hasattr(__lowerCamelCase      ,		__lowerCamelCase						) and getattr(__lowerCamelCase      ,		__lowerCamelCase						) is not None:
             __A					:		Tuple						=  getattr(__lowerCamelCase      ,		__lowerCamelCase						)
             weight.data.fill_(3						)






@require_torch
class 	__snake_case      (	SCREAMING_SNAKE_CASE__							,							unittest.TestCase  ):





 """simple docstring"""


 _lowerCamelCase				 =  False
 _lowerCamelCase				 =  False
 _lowerCamelCase				 =  (
     (FunnelBaseModel, FunnelForMultipleChoice, FunnelForSequenceClassification) if is_torch_available() else ()
 )

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Optional[Any]						=  FunnelModelTester(self      ,		base=__lowerCamelCase						)
     __A					:		List[str]						=  ConfigTester(self      ,		config_class=__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     self.config_tester.run_common_tests()

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Any						=  self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_base_model(*__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Tuple						=  self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_for_sequence_classification(*__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		List[Any]						=  self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_for_multiple_choice(*__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A				, __A					:		List[Any]						=  self.model_tester.prepare_config_and_inputs_for_common()
     __A					:		str						=  True

     for model_class in self.all_model_classes:
         if model_class.__name__ == "FunnelBaseModel":
             continue
         __A					:		Union[str, Any]						=  model_class(__lowerCamelCase						)
         model.to(__lowerCamelCase						)
         model.train()
         __A					:		Any						=  self._prepare_for_class(__lowerCamelCase      ,		__lowerCamelCase      ,		return_labels=__lowerCamelCase						)
         __A					:		Union[str, Any]						=  model(**__lowerCamelCase						).loss
         loss.backward()







 def       UpperCamelCase__(					self      ,		__lowerCamelCase						):



     '''simple docstring'''




     if hasattr(__lowerCamelCase      ,		'''weight'''						) and module.weight is not None:
         module.weight.data.fill_(3						)
     if hasattr(__lowerCamelCase      ,		'''bias'''						) and module.bias is not None:
         module.bias.data.fill_(3						)

     for param in ["r_w_bias", "r_r_bias", "r_kernel", "r_s_bias", "seg_embed"]:
         if hasattr(__lowerCamelCase      ,		__lowerCamelCase						) and getattr(__lowerCamelCase      ,		__lowerCamelCase						) is not None:
             __A					:		Optional[Any]						=  getattr(__lowerCamelCase      ,		__lowerCamelCase						)
             weight.data.fill_(3						)






@require_torch
@require_sentencepiece
@require_tokenizers
class 	__snake_case      (	unittest.TestCase  ):





 """simple docstring"""


 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Optional[int]						=  13
     __A					:		Dict						=  7
     __A					:		str						=  torch.arange(0      ,		batch_size * sequence_length						).long().reshape(__lowerCamelCase      ,		__lowerCamelCase						)
     __A					:		Optional[Any]						=  [0, 1, 2, 3, 4, 5, 6, 4, 1, 3, 5, 0, 1]
     __A					:		Dict						=  torch.tensor([[2] + [0] * a + [1] * (sequence_length - a - 1) for a in lengths]						)

     __A					:		Tuple						=  FunnelModel.from_pretrained('''sgugger/funnel-random-tiny'''						)
     __A					:		str						=  model(__lowerCamelCase      ,		token_type_ids=__lowerCamelCase						)[0].abs()

     __A					:		Any						=  torch.tensor(2_3_4_4.8_3_5_2						)
     __A					:		Union[str, Any]						=  torch.tensor(0.8_0_5_2						)
     self.assertTrue(torch.allclose(output.sum()      ,		__lowerCamelCase      ,		atol=1e-4						)						)
     self.assertTrue(torch.allclose(output.mean()      ,		__lowerCamelCase      ,		atol=1e-4						)						)

     __A					:		Any						=  torch.tensor([[1] * 7, [1] * 4 + [0] * 3] * 6 + [[0, 1, 1, 0, 0, 1, 1]]						)
     __A					:		Any						=  model(__lowerCamelCase      ,		attention_mask=__lowerCamelCase      ,		token_type_ids=__lowerCamelCase						)[0].abs()

     __A					:		List[str]						=  torch.tensor(2_3_4_3.8_4_2_5						)
     __A					:		Optional[Any]						=  torch.tensor(0.8_0_4_9						)
     self.assertTrue(torch.allclose(output.sum()      ,		__lowerCamelCase      ,		atol=1e-4						)						)
     self.assertTrue(torch.allclose(output.mean()      ,		__lowerCamelCase      ,		atol=1e-4						)						)







 @slow
 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		List[str]						=  FunnelTokenizer.from_pretrained('''huggingface/funnel-small'''						)
     __A					:		Any						=  FunnelModel.from_pretrained('''huggingface/funnel-small'''						)
     __A					:		str						=  tokenizer('''Hello! I am the Funnel Transformer model.'''      ,		return_tensors='''pt'''						)
     __A					:		Dict						=  model(**__lowerCamelCase						)[0]

     __A					:		int						=  torch.tensor(2_3_5.7_2_4_6						)
     __A					:		Tuple						=  torch.tensor(0.0_2_5_6						)
     self.assertTrue(torch.allclose(output.sum()      ,		__lowerCamelCase      ,		atol=1e-4						)						)
     self.assertTrue(torch.allclose(output.mean()      ,		__lowerCamelCase      ,		atol=1e-4						)						)











"""simple docstring"""



import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


a_				=    """
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 	__snake_case      (	unittest.TestCase							,							SCREAMING_SNAKE_CASE__  ):





 """simple docstring"""


 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Optional[Any]						=  load_tool('''summarization'''						)
     self.tool.setup()
     __A					:		Tuple						=  load_tool('''summarization'''      ,		remote=__lowerCamelCase						)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		List[str]						=  self.tool(__lowerCamelCase						)
     self.assertEqual(
         __lowerCamelCase      ,		'''Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. 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. In 2022, the workshop concluded with the announcement of BLOOM.'''      ,		)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		int						=  self.remote_tool(__lowerCamelCase						)
     self.assertEqual(
         __lowerCamelCase      ,		'''Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. 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. In 2022, the workshop concluded with the announcement of BLOOM.'''      ,		)

 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		List[Any]						=  self.tool(text=__lowerCamelCase						)
     self.assertEqual(
         __lowerCamelCase      ,		'''Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. 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. In 2022, the workshop concluded with the announcement of BLOOM.'''      ,		)







 def       UpperCamelCase__(					self						):



     '''simple docstring'''




     __A					:		Optional[int]						=  self.remote_tool(text=__lowerCamelCase						)
     self.assertEqual(
         __lowerCamelCase      ,		'''Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. 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. In 2022, the workshop concluded with the announcement of BLOOM.'''      ,		)




