🚀 輕量級GPT2小型對話模型
本模型是基於 distilgpt2 在經過解析的維基百科嚮導(Wizard of Wikipedia)數據集上微調得到的。它採用了人物A/人物B的框架,專為與 ai-msgbot 集成使用而設計。該模型在評估集上取得了以下結果:
🚀 快速開始
模型推理參數
{
"parameters": {
"min_length": 2,
"max_length": 64,
"length_penalty": 0.7,
"no_repeat_ngram_size": 2,
"do_sample": true,
"top_p": 0.95,
"top_k": 20,
"temperature": 0.3,
"repetition_penalty": 3.5
}
}
模型使用示例
你可以在下面的示例中輸入文本進行測試:
示例標題 |
輸入文本 |
散步 |
"I know you're tired, but can we go for another walk this evening? person beta:
" |
活動 |
"Have you done anything exciting lately? person beta:
" |
雜貨店 |
"hey - do you have a favorite grocery store around here? person beta:
" |
晚餐 |
"Can you take me for dinner somewhere nice this time? person beta:
" |
社交媒體 |
"What's your favorite form of social media? person beta:
" |
問候 |
"Hi, how are you? person beta:
" |
姐妹 |
"I am the best; my sister is the worst. What am I? person beta:
" |
短吻鱷 |
"What do you call an alligator who's just had surgery to remove his left arm? person beta:
" |
美元 |
"A man walks into a bar and asks for a drink. The bartender asks for $10, and he pays him $1. What did he pay him with? person beta:
" |
郵箱 |
"What did I say was in the mailbox when it was actually in the cabinet? person beta:
" |
語言 |
"My friend says that she knows every language, but she doesn't speak any of them.. what's wrong with her? person beta:
" |
你還可以查看 簡單演示。
✨ 主要特性
- 這是一個基礎的對話模型,可作為聊天機器人使用。
- 專為與 ai-msgbot 集成而設計。
- 能夠生成人物A和人物B之間的完整對話,使用
person alpha
和 person beta
作為自定義 <bos>
標記來區分不同的回覆。
📚 詳細文檔
預期用途與限制
本模型的設計用途是與 ai-msgbot 倉庫集成。需要注意的是,該模型生成的是人物A和人物B之間的完整對話,使用 person alpha
和 person beta
作為自定義 <bos>
標記來確定一個回覆的結束和另一個回覆的開始。
訓練和評估數據
訓練和評估數據來自經過解析的 維基百科嚮導 數據集,該數據集來自 ParlAI。
訓練過程
本模型使用了 DeepSpeed 和 Hugging Face 訓練器進行訓練,ai-msgbot 倉庫中有示例筆記本可供參考。
訓練超參數
以下是訓練過程中使用的超參數:
參數 |
值 |
學習率 |
2e-05 |
訓練批次大小 |
32 |
評估批次大小 |
32 |
隨機種子 |
42 |
分佈式類型 |
多GPU |
梯度累積步數 |
4 |
總訓練批次大小 |
128 |
優化器 |
Adam(β1 = 0.9,β2 = 0.999,ε = 1e-08) |
學習率調度器類型 |
餘弦 |
學習率調度器熱身比例 |
0.05 |
訓練輪數 |
30 |
訓練結果
訓練損失 |
輪數 |
步數 |
驗證損失 |
無日誌記錄 |
1.0 |
418 |
2.7793 |
2.9952 |
2.0 |
836 |
2.6914 |
2.7684 |
3.0 |
1254 |
2.6348 |
2.685 |
4.0 |
1672 |
2.5938 |
2.6243 |
5.0 |
2090 |
2.5625 |
2.5816 |
6.0 |
2508 |
2.5332 |
2.5816 |
7.0 |
2926 |
2.5098 |
2.545 |
8.0 |
3344 |
2.4902 |
2.5083 |
9.0 |
3762 |
2.4707 |
2.4793 |
10.0 |
4180 |
2.4551 |
2.4531 |
11.0 |
4598 |
2.4395 |
2.4269 |
12.0 |
5016 |
2.4238 |
2.4269 |
13.0 |
5434 |
2.4102 |
2.4051 |
14.0 |
5852 |
2.3945 |
2.3777 |
15.0 |
6270 |
2.3848 |
2.3603 |
16.0 |
6688 |
2.3711 |
2.3394 |
17.0 |
7106 |
2.3613 |
2.3206 |
18.0 |
7524 |
2.3516 |
2.3206 |
19.0 |
7942 |
2.3398 |
2.3026 |
20.0 |
8360 |
2.3301 |
2.2823 |
21.0 |
8778 |
2.3203 |
2.2669 |
22.0 |
9196 |
2.3105 |
2.2493 |
23.0 |
9614 |
2.3027 |
2.2334 |
24.0 |
10032 |
2.2930 |
2.2334 |
25.0 |
10450 |
2.2852 |
2.2194 |
26.0 |
10868 |
2.2754 |
2.2014 |
27.0 |
11286 |
2.2695 |
2.1868 |
28.0 |
11704 |
2.2598 |
2.171 |
29.0 |
12122 |
2.2539 |
2.1597 |
30.0 |
12540 |
2.2461 |
框架版本
- Transformers 4.16.1
- Pytorch 1.10.0+cu111
- Tokenizers 0.11.0
📄 許可證
本模型採用 Apache 2.0 許可證。