[LongT5] Correct docs long t5 (#18669)

* add first generation tutorial

* [LongT5 Docs] Correct docs

* correct expected string

* remove incorrect file
This commit is contained in:
Patrick von Platen 2022-08-18 10:03:50 +02:00 committed by GitHub
parent 582c537175
commit 0ea53822f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -1966,13 +1966,12 @@ class LongT5ForConditionalGeneration(LongT5PreTrainedModel):
... )
>>> # Let's try a very long input.
>>> input_ids = tokenizer(
... "summarize: " + 100 * "studies have shown that owning a dog is good for you ", return_tensors="pt"
... ).input_ids # Batch size 1
>>> inputs = tokenizer(100 * "studies have shown that owning a dog is good for you ", return_tensors="pt")
>>> input_ids = inputs.input_ids
>>> outputs = model.generate(input_ids)
>>> print(tokenizer.decode(outputs[0], skip_special_tokens=True))
abstractthe aim of this article is to summarize the studies have shown that owning a dog
abstractthe aim of this article is to provide an overview of the literature on the role of dog
```"""
use_cache = use_cache if use_cache is not None else self.config.use_cache
return_dict = return_dict if return_dict is not None else self.config.use_return_dict