# FLAN-T5

## Tổng quan

FLAN-T5 được công bố trong bài báo [Scaling Instruction-Finetuned Language Models](https://huggingface.co/papers/2210.11416) - đây là phiên bản nâng cao của T5, được finetune trên một hỗn hợp các tác vụ.

Có thể sử dụng trực tiếp trọng số FLAN-T5 mà không cần tinh chỉnh mô hình:

```python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")

inputs = tokenizer("A step by step recipe to make bolognese pasta:", return_tensors="pt").to(model.device)
outputs = model.generate(**inputs)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
['Pour a cup of bolognese into a large bowl and add the pasta']
```

FLAN-T5 bao gồm các cải tiến tương tự như T5 phiên bản 1.1 (xem [tại đây](./t5v1.1) để biết chi tiết đầy đủ về các cải tiến của mô hình.)

Google đã phát hành các biến thể sau:

- [google/flan-t5-small](https://huggingface.co/google/flan-t5-small)

- [google/flan-t5-base](https://huggingface.co/google/flan-t5-base)

- [google/flan-t5-large](https://huggingface.co/google/flan-t5-large)

- [google/flan-t5-xl](https://huggingface.co/google/flan-t5-xl)

- [google/flan-t5-xxl](https://huggingface.co/google/flan-t5-xxl).

Các checkpoint gốc có thể được tìm thấy [tại đây](https://github.com/google-research/t5x/blob/main/docs/models.md#flan-t5-checkpoints).

Tham khảo [trang tài liệu của T5](./t5) để xem đầy đủ tham chiếu API, ví dụ mã và notebook. Để biết thêm chi tiết về việc huấn luyện và đánh giá FLAN-T5, hãy tham khảo thẻ mô hình.

