mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Adding doctest for text2text-generation
pipeline. (#20261)
This commit is contained in:
parent
f6490180eb
commit
449f2ae459
@ -27,6 +27,21 @@ class Text2TextGenerationPipeline(Pipeline):
|
||||
"""
|
||||
Pipeline for text to text generation using seq2seq models.
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
>>> from transformers import pipeline
|
||||
|
||||
>>> generator = pipeline(model="mrm8488/t5-base-finetuned-question-generation-ap")
|
||||
>>> generator(
|
||||
... "answer: Manuel context: Manuel has created RuPERTa-base with the support of HF-Transformers and Google"
|
||||
... )
|
||||
[{'generated_text': 'question: Who created the RuPERTa-base?'}]
|
||||
```
|
||||
|
||||
[Learn more about the basics of using a pipeline in the [pipeline tutorial]](../pipeline_tutorial)
|
||||
|
||||
|
||||
This Text2TextGenerationPipeline pipeline can currently be loaded from [`pipeline`] using the following task
|
||||
identifier: `"text2text-generation"`.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user