🚀 FLAN - T5 base モデルカード
FLAN - T5 baseは、多言語対応のテキスト生成モデルです。様々な自然言語処理タスク、例えば質問応答や翻訳などに利用できます。
🚀 クイックスタート
以下は、transformers
ライブラリを使用してこのモデルを使う例です。
💻 使用例
基本的な使用法
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained("AlexWortega/Flan_base_translated")
model = T5ForConditionalGeneration.from_pretrained("AlexWortega/Flan_base_translated")
input_text = "translate English to German: How old are you?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
高度な使用法
GPUでの実行
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained("AlexWortega/Flan_base_translated")
model = T5ForConditionalGeneration.from_pretrained("AlexWortega/Flan_base_translated", device_map="auto")
input_text = "translate English to German: How old are you?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
異なる精度でGPUを使用する場合
FP16
import torch
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained("AlexWortega/Flan_base_translated")
model = T5ForConditionalGeneration.from_pretrained("AlexWortega/Flan_base_translated", device_map="auto", torch_dtype=torch.float16)
input_text = "translate English to German: How old are you?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
INT8
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained("AlexWortega/Flan_base_translated")
model = T5ForConditionalGeneration.from_pretrained("AlexWortega/Flan_base_translated", device_map="auto", load_in_8bit=True)
input_text = "translate English to German: How old are you?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
✨ 主な機能
直接利用と下流利用
著者らは元論文のモデルカードで、以下のように述べています。
主な用途は、言語モデルの研究です。これには、ゼロショット自然言語処理タスクやインコンテキストのフューショット学習自然言語処理タスク(推論や質問応答など)の研究、公平性と安全性の研究の推進、および現在の大規模言語モデルの制限の理解が含まれます。
詳細については研究論文を参照してください。
範囲外の利用
詳細情報が必要です。
🔧 技術詳細
バイアス、リスク、制限事項
以下の情報は、モデルの公式モデルカードからコピーされたものです。
Raeら(2021)によると、Flan - T5を含む言語モデルは、有害な方法での言語生成に潜在的に利用される可能性があります。Flan - T5は、アプリケーション固有の安全性と公平性の懸念を事前に評価せずに、直接アプリケーションに使用してはなりません。
倫理的な考慮事項とリスク
Flan - T5は、明示的なコンテンツについてフィルタリングされていない、または既存のバイアスについて評価されていない大量のテキストデータでファインチューニングされています。その結果、モデル自体は、同等の不適切なコンテンツを生成したり、基盤となるデータに内在するバイアスを再現したりする可能性があります。
既知の制限事項
Flan - T5は、実世界のアプリケーションでテストされていません。
敏感な利用
Flan - T5は、容認できないユースケース(例えば、侮辱的なスピーチの生成)には適用してはなりません。
トレーニング詳細
トレーニングデータ
- svakulenk0/qrecc
- taskmaster2
- djaym7/wiki_dialog
- deepmind/code_contests
- lambada
- gsm8k
- aqua_rat
- esnli
- quasc
- qed
トレーニング手順
情報はありません。
評価
テストデータ、要因、メトリクス
情報はありません。
引用
@misc{https://doi.org/10.48550/arxiv.2210.11416,
doi = {10.48550/ARXIV.2210.11416},
url = {https://arxiv.org/abs/2210.11416},
author = {Chung, Hyung Won and Hou, Le and Longpre, Shayne and Zoph, Barret and Tay, Yi and Fedus, William and Li, Eric and Wang, Xuezhi and Dehghani, Mostafa and Brahma, Siddhartha and Webson, Albert and Gu, Shixiang Shane and Dai, Zhuyun and Suzgun, Mirac and Chen, Xinyun and Chowdhery, Aakanksha and Narang, Sharan and Mishra, Gaurav and Yu, Adams and Zhao, Vincent and Huang, Yanping and Dai, Andrew and Yu, Hongkun and Petrov, Slav and Chi, Ed H. and Dean, Jeff and Devlin, Jacob and Roberts, Adam and Zhou, Denny and Le, Quoc V. and Wei, Jason},
keywords = {Machine Learning (cs.LG), Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Scaling Instruction-Finetuned Language Models},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution 4.0 International}
}
📄 ライセンス
このモデルは、Apache - 2.0ライセンスの下で提供されています。