Transformers documentation

FLAN-T5

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v5.22.2).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Mô hình này được công bố trên HF papers vào ngày 2022-10-20 và được đóng góp cho Hugging Face Transformers vào ngày 2023-06-20.

FLAN-T5

Tổng quan

FLAN-T5 được công bố trong bài báo Scaling Instruction-Finetuned Language Models - đâ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:

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 để 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:

Các checkpoint gốc có thể được tìm thấy tại đây.

Tham khảo trang tài liệu của 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.

Update on GitHub