Unverified Commit aa6a29bc authored by Julien Chaumond's avatar Julien Chaumond Committed by GitHub
Browse files

SummarizationPipeline: init required task name (#5086)



* SummarizationPipeline: init required task name

* Update src/transformers/pipelines.py
Co-authored-by: default avatarSam Shleifer <sshleifer@gmail.com>

* Apply suggestions from code review
Co-authored-by: default avatarSam Shleifer <sshleifer@gmail.com>
parent 2fd28d43
...@@ -1391,6 +1391,10 @@ class SummarizationPipeline(Pipeline): ...@@ -1391,6 +1391,10 @@ class SummarizationPipeline(Pipeline):
on the associated CUDA device id. on the associated CUDA device id.
""" """
def __init__(self, **kwargs):
kwargs.update(task="summarization")
super().__init__(**kwargs)
def __call__( def __call__(
self, *documents, return_tensors=False, return_text=True, clean_up_tokenization_spaces=False, **generate_kwargs self, *documents, return_tensors=False, return_text=True, clean_up_tokenization_spaces=False, **generate_kwargs
): ):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment