🚀 LaMini-Flan-T5-783M
LaMini-Flan-T5-783M 是 LaMini-LM 模型系列中的一員,基於大規模指令進行蒸餾得到。它在文本生成任務上表現出色,能根據自然語言指令生成高質量的回覆。
🚀 快速開始
本模型推薦用於響應自然語言編寫的人類指令。下面展示如何使用 HuggingFace 的 pipeline()
加載和使用該模型:
from transformers import pipeline
checkpoint = "{model_name}"
model = pipeline('text2text-generation', model = checkpoint)
input_prompt = 'Please let me know your thoughts on the given place and why you think it deserves to be visited: \n"Barcelona, Spain"'
generated_text = model(input_prompt, max_length=512, do_sample=True)[0]['generated_text']
print("Response", generated_text)
✨ 主要特性
- 指令微調:在包含 258 萬個樣本的 LaMini-instruction 數據集上進行微調,能更好地響應自然語言指令。
- 模型系列豐富:LaMini-LM 系列包含多種基於不同基礎模型的變體,可根據需求選擇。
📦 安裝指南
使用前需安裝必要的庫,可通過以下命令安裝:
pip install -q transformers
💻 使用示例
基礎用法
from transformers import pipeline
checkpoint = "{model_name}"
model = pipeline('text2text-generation', model = checkpoint)
input_prompt = 'Please let me know your thoughts on the given place and why you think it deserves to be visited: \n"Barcelona, Spain"'
generated_text = model(input_prompt, max_length=512, do_sample=True)[0]['generated_text']
print("Response", generated_text)
📚 詳細文檔
模型信息
本模型是 google/flan-t5-large 在 LaMini-instruction 數據集 上的微調版本,總參數數量為 7.83 億。
模型系列
你可以查看 LaMini-LM 系列的其他模型,帶有 ✩ 的模型在其規模/架構下整體性能最佳,推薦使用。更多細節可參考論文。
訓練過程
模型使用 [google/flan-t5-large](https://huggingface.co/google/flan-t5-large) 初始化,並在 [LaMini-instruction 數據集](https://huggingface.co/datasets/MBZUAI/LaMini-instruction) 上進行微調。
訓練超參數
訓練過程中使用了以下超參數:
- 學習率:0.0005
- 訓練批次大小:128
- 評估批次大小:64
- 隨機種子:42
- 梯度累積步數:4
- 總訓練批次大小:512
- 優化器:Adam(β1 = 0.9,β2 = 0.999,ε = 1e-08)
- 學習率調度器類型:線性
- 訓練輪數:5
評估
我們進行了兩組評估:下游 NLP 任務的自動評估和麵向用戶指令的人工評估。更多細節請參考 論文。
侷限性
更多信息待補充。
🔧 技術細節
本模型基於 Transformer 架構,通過在大規模指令數據集上的微調,學習到了自然語言的模式和語義信息,從而能夠更好地響應人類指令。
📄 許可證
本模型採用 CC By NC 4.0 許可證。
引用
@article{lamini-lm,
author = {Minghao Wu and
Abdul Waheed and
Chiyu Zhang and
Muhammad Abdul-Mageed and
Alham Fikri Aji
},
title = {LaMini-LM: A Diverse Herd of Distilled Models from Large-Scale Instructions},
journal = {CoRR},
volume = {abs/2304.14402},
year = {2023},
url = {https://arxiv.org/abs/2304.14402},
eprinttype = {arXiv},
eprint = {2304.14402}
}