
"""simple docstring"""


import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


__A 		= '\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 	lowerCamelCase__      (      unittest.TestCase				,			lowercase_       ):





			'''simple docstring'''



			def       _lowerCAmelCase	(							self						)				->  Any:
				_lowerCAmelCase			=load_tool("""summarization"""						)
				self.tool.setup()
				_lowerCAmelCase			=load_tool("""summarization"""  ,  remote=__UpperCAmelCase						)



			def       _lowerCAmelCase	(							self						)				->  Tuple:
				_lowerCAmelCase			=self.tool(__UpperCAmelCase						)
				self.assertEqual(
				    __UpperCAmelCase  ,  """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       _lowerCAmelCase	(							self						)				->  List[str]:
				_lowerCAmelCase			=self.remote_tool(__UpperCAmelCase						)
				self.assertEqual(
				    __UpperCAmelCase  ,  """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       _lowerCAmelCase	(							self						)				->  int:
				_lowerCAmelCase			=self.tool(text=__UpperCAmelCase						)
				self.assertEqual(
				    __UpperCAmelCase  ,  """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       _lowerCAmelCase	(							self						)				->  Dict:
				_lowerCAmelCase			=self.remote_tool(text=__UpperCAmelCase						)
				self.assertEqual(
				    __UpperCAmelCase  ,  """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."""  ,  )

"""simple docstring"""


from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


__A 		= logging.get_logger(__name__)

__A 		= {
    'nghuyong/ernie-1.0-base-zh': 'https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json',
    'nghuyong/ernie-2.0-base-en': 'https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json',
    'nghuyong/ernie-2.0-large-en': 'https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json',
    'nghuyong/ernie-3.0-base-zh': 'https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-medium-zh': 'https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-mini-zh': 'https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-micro-zh': 'https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json',
    'nghuyong/ernie-3.0-nano-zh': 'https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json',
    'nghuyong/ernie-gram-zh': 'https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json',
    'nghuyong/ernie-health-zh': 'https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json',
}







class 	lowerCamelCase__      (      __magic_name__       ):





			'''simple docstring'''
			lowerCamelCase						      =	'''ernie'''



			def __init__(							self  ,  __UpperCAmelCase=3_05_22  ,  __UpperCAmelCase=7_68  ,  __UpperCAmelCase=12  ,  __UpperCAmelCase=12  ,  __UpperCAmelCase=30_72  ,  __UpperCAmelCase="gelu"  ,  __UpperCAmelCase=0.1  ,  __UpperCAmelCase=0.1  ,  __UpperCAmelCase=5_12  ,  __UpperCAmelCase=2  ,  __UpperCAmelCase=3  ,  __UpperCAmelCase=False  ,  __UpperCAmelCase=0.0_2  ,  __UpperCAmelCase=1e-12  ,  __UpperCAmelCase=0  ,  __UpperCAmelCase="absolute"  ,  __UpperCAmelCase=True  ,  __UpperCAmelCase=None  ,  **__UpperCAmelCase  ,  )				->  str:
				super().__init__(pad_token_id=__UpperCAmelCase  ,  **__UpperCAmelCase						)

				_lowerCAmelCase			=vocab_size
				_lowerCAmelCase			=hidden_size
				_lowerCAmelCase			=num_hidden_layers
				_lowerCAmelCase			=num_attention_heads
				_lowerCAmelCase			=hidden_act
				_lowerCAmelCase			=intermediate_size
				_lowerCAmelCase			=hidden_dropout_prob
				_lowerCAmelCase			=attention_probs_dropout_prob
				_lowerCAmelCase			=max_position_embeddings
				_lowerCAmelCase			=type_vocab_size
				_lowerCAmelCase			=task_type_vocab_size
				_lowerCAmelCase			=use_task_id
				_lowerCAmelCase			=initializer_range
				_lowerCAmelCase			=layer_norm_eps
				_lowerCAmelCase			=position_embedding_type
				_lowerCAmelCase			=use_cache
				_lowerCAmelCase			=classifier_dropout







class 	lowerCamelCase__      (      __magic_name__       ):





			'''simple docstring'''



			@property
			def       _lowerCAmelCase	(							self						)				->  Mapping[str, Mapping[int, str]]:
				if self.task == "multiple-choice":
					_lowerCAmelCase			={0: """batch""", 1: """choice""", 2: """sequence"""}
				else:
					_lowerCAmelCase			={0: """batch""", 1: """sequence"""}
				return OrderedDict(
				    [
				        ("""input_ids""", dynamic_axis),
				        ("""attention_mask""", dynamic_axis),
				        ("""token_type_ids""", dynamic_axis),
				        ("""task_type_ids""", dynamic_axis),
				    ]						)



