"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "7f9b7b3f0e181e2393fc5b5c70ad2da2a190aa08"
Unverified Commit 449f2ae4 authored by Nicolas Patry's avatar Nicolas Patry Committed by GitHub
Browse files

Adding doctest for `text2text-generation` pipeline. (#20261)

parent f6490180
...@@ -27,6 +27,21 @@ class Text2TextGenerationPipeline(Pipeline): ...@@ -27,6 +27,21 @@ class Text2TextGenerationPipeline(Pipeline):
""" """
Pipeline for text to text generation using seq2seq models. 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 This Text2TextGenerationPipeline pipeline can currently be loaded from [`pipeline`] using the following task
identifier: `"text2text-generation"`. identifier: `"text2text-generation"`.
......
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