



"""simple docstring"""






# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from ..models.auto import AutoModelForSeqaSeqLM, AutoTokenizer
from .base import PipelineTool



class      A__  (    __SCREAMING_SNAKE_CASE				):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE        =      'philschmid/bart-large-cnn-samsum'
	SCREAMING_SNAKE_CASE        =      (
	    'This is a tool that summarizes an English text. It takes an input `text` containing the text to summarize, '
	    'and returns a summary of the text.'
	)
	SCREAMING_SNAKE_CASE        =      'summarizer'
	SCREAMING_SNAKE_CASE        =      AutoTokenizer
	SCREAMING_SNAKE_CASE        =      AutoModelForSeqaSeqLM

	SCREAMING_SNAKE_CASE        =      ['text']
	SCREAMING_SNAKE_CASE        =      ['text']

	def 				_SCREAMING_SNAKE_CASE  (	self:						str			,     _SCREAMING_SNAKE_CASE:						Tuple)							->			Any:

				"""simple docstring"""

				return self.pre_processor(_SCREAMING_SNAKE_CASE			,     return_tensors="pt"			,     truncation=_SCREAMING_SNAKE_CASE)

	def 				_SCREAMING_SNAKE_CASE  (	self:						Optional[Any]			,     _SCREAMING_SNAKE_CASE:						int)							->			str:

				"""simple docstring"""

				return self.model.generate(**_SCREAMING_SNAKE_CASE)[0]







	def 				_SCREAMING_SNAKE_CASE  (	self:						Optional[Any]			,     _SCREAMING_SNAKE_CASE:						int)							->			Union[str, Any]:

				"""simple docstring"""

				return self.pre_processor.decode(_SCREAMING_SNAKE_CASE			,     skip_special_tokens=_SCREAMING_SNAKE_CASE			,     clean_up_tokenization_spaces=_SCREAMING_SNAKE_CASE)




"""simple docstring"""






from ..utils import DummyObject, requires_backends



class      A__  (    metaclass=__SCREAMING_SNAKE_CASE				):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE        =      ['torch', 'transformers', 'onnx']

	def __init__(	self:						Union[str, Any]			,     *_SCREAMING_SNAKE_CASE:						Any			,     **_SCREAMING_SNAKE_CASE:						int)							->			List[Any]:

				"""simple docstring"""

				requires_backends(self			,     ["torch", "transformers", "onnx"])

	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						Union[str, Any]			,     *_SCREAMING_SNAKE_CASE:						List[Any]			,     **_SCREAMING_SNAKE_CASE:						Union[str, Any])							->			Union[str, Any]:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])







	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						int			,     *_SCREAMING_SNAKE_CASE:						Any			,     **_SCREAMING_SNAKE_CASE:						str)							->			Union[str, Any]:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])






class      A__  (    metaclass=__SCREAMING_SNAKE_CASE				):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE        =      ['torch', 'transformers', 'onnx']

	def __init__(	self:						Tuple			,     *_SCREAMING_SNAKE_CASE:						Optional[Any]			,     **_SCREAMING_SNAKE_CASE:						List[str])							->			Optional[int]:

				"""simple docstring"""

				requires_backends(self			,     ["torch", "transformers", "onnx"])

	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						Dict			,     *_SCREAMING_SNAKE_CASE:						Optional[Any]			,     **_SCREAMING_SNAKE_CASE:						int)							->			List[Any]:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])







	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						Optional[Any]			,     *_SCREAMING_SNAKE_CASE:						Dict			,     **_SCREAMING_SNAKE_CASE:						Optional[Any])							->			Union[str, Any]:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])






class      A__  (    metaclass=__SCREAMING_SNAKE_CASE				):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE        =      ['torch', 'transformers', 'onnx']

	def __init__(	self:						int			,     *_SCREAMING_SNAKE_CASE:						List[Any]			,     **_SCREAMING_SNAKE_CASE:						int)							->			List[str]:

				"""simple docstring"""

				requires_backends(self			,     ["torch", "transformers", "onnx"])

	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						Dict			,     *_SCREAMING_SNAKE_CASE:						Any			,     **_SCREAMING_SNAKE_CASE:						Any)							->			str:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])







	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						List[Any]			,     *_SCREAMING_SNAKE_CASE:						List[str]			,     **_SCREAMING_SNAKE_CASE:						int)							->			int:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])






class      A__  (    metaclass=__SCREAMING_SNAKE_CASE				):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE        =      ['torch', 'transformers', 'onnx']

	def __init__(	self:						Tuple			,     *_SCREAMING_SNAKE_CASE:						List[str]			,     **_SCREAMING_SNAKE_CASE:						List[str])							->			Optional[Any]:

				"""simple docstring"""

				requires_backends(self			,     ["torch", "transformers", "onnx"])

	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						List[str]			,     *_SCREAMING_SNAKE_CASE:						Tuple			,     **_SCREAMING_SNAKE_CASE:						int)							->			int:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])







	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						Optional[int]			,     *_SCREAMING_SNAKE_CASE:						str			,     **_SCREAMING_SNAKE_CASE:						Any)							->			int:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])






class      A__  (    metaclass=__SCREAMING_SNAKE_CASE				):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE        =      ['torch', 'transformers', 'onnx']

	def __init__(	self:						Optional[Any]			,     *_SCREAMING_SNAKE_CASE:						Union[str, Any]			,     **_SCREAMING_SNAKE_CASE:						Optional[int])							->			str:

				"""simple docstring"""

				requires_backends(self			,     ["torch", "transformers", "onnx"])

	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						Optional[int]			,     *_SCREAMING_SNAKE_CASE:						List[Any]			,     **_SCREAMING_SNAKE_CASE:						Tuple)							->			Union[str, Any]:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])







	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						int			,     *_SCREAMING_SNAKE_CASE:						str			,     **_SCREAMING_SNAKE_CASE:						Any)							->			Optional[Any]:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])






class      A__  (    metaclass=__SCREAMING_SNAKE_CASE				):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE        =      ['torch', 'transformers', 'onnx']

	def __init__(	self:						List[Any]			,     *_SCREAMING_SNAKE_CASE:						List[str]			,     **_SCREAMING_SNAKE_CASE:						List[str])							->			int:

				"""simple docstring"""

				requires_backends(self			,     ["torch", "transformers", "onnx"])

	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						Union[str, Any]			,     *_SCREAMING_SNAKE_CASE:						Optional[int]			,     **_SCREAMING_SNAKE_CASE:						Optional[Any])							->			List[Any]:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])







	@classmethod
	def 				_SCREAMING_SNAKE_CASE  (	cls:						str			,     *_SCREAMING_SNAKE_CASE:						Optional[int]			,     **_SCREAMING_SNAKE_CASE:						Dict)							->			Optional[Any]:

				"""simple docstring"""

				requires_backends(cls			,     ["torch", "transformers", "onnx"])