Skip to content

Commit ffabbb1

Browse files
committed
add more content
1 parent b0e2eb0 commit ffabbb1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/source/en/model_doc/flan-t5.mdx

+10-4
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ specific language governing permissions and limitations under the License.
1616

1717
FLAN-T5 was released in the paper [Scaling Instruction-Finetuned Language Models](https://arxiv.org/pdf/2210.11416.pdf) - it is an enhanced version of T5 that has been finetuned in a mixture of tasks.
1818

19-
One can directly plug in the weights of FLAN-T5 into a T5 model, like so:
19+
One can directly use FLAN-T5 weights without finetuning the model:
2020

2121
```python
22-
>>> from transformers import T5ForConditionalGeneration
22+
>>> from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
2323

24-
>>> model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-base")
24+
>>> model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")
25+
>>> tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")
26+
27+
>>> inputs = tokenizer("A step by step recipe to make bolognese pasta:", return_tensors="pt")
28+
>>> outputs = model.generate(**inputs)
29+
>>> print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
30+
['Pour a cup of bolognese into a large bowl and add the pasta']
2531
```
2632
2733
FLAN-T5 includes the same improvements as T5 version 1.1 (see [here](https://huggingface.co/docs/transformers/model_doc/t5v1.1) for the full details of the model's improvements.)
@@ -38,6 +44,6 @@ Google has released the following variants:
3844
3945
- [google/flan-t5-xxl](https://huggingface.co/google/flan-t5-xxl).
4046
41-
One can refer to [T5's documentation page](t5) for all tips, code examples and notebooks.
47+
One can refer to [T5's documentation page](t5) for all tips, code examples and notebooks. As well as the FLAN-T5 model card for more details regarding training and evaluation of the model.
4248
4349
The original checkpoints can be found [here](https://github.com/google-research/t5x/blob/main/docs/models.md#mixture-of-experts-moe-checkpoints).

0 commit comments

Comments
 (0)