[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:
parent
582c537175
commit
0ea53822f8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue