🚀 C4AI Command R+模型GGUF量化版本
本項目提供了https://huggingface.co/CohereForAI/c4ai-command-r-plus 模型的GGUF重要性矩陣(imatrix)量化版本。旨在為用戶提供不同量化方案,以平衡模型大小和性能。
🚀 快速開始
版本更新記錄
- 2024-05-05:隨著提交
889bdd7
合併,該模型現在支持BPE預分詞,後續將刷新所有量化版本。
- 2024-04-09:對該模型的支持已合併到主分支。
重要提示
⚠️ 重要提示
不要直接拼接分割文件(或塊),如果需要合併文件,可使用 gguf-split
工具(大多數使用場景可能不需要)。
✨ 主要特性
- 重要性矩陣訓練:重要性矩陣使用 wiki.train.raw 數據集對約100K個標記(200批次,每批次512個標記)進行訓練。
- GGUF選擇參考:可參考 Which GGUF is right for me? (from Artefact2) 選擇合適的GGUF量化版本,X軸為文件大小,Y軸為困惑度(困惑度越低,質量越好)。部分性能平衡點(大小與PPL)為IQ4_XS、IQ3_M/IQ3_S、IQ3_XS/IQ3_XXS、IQ2_M和IQ2_XS。
- K量化使用imatrix:imatrix已應用於K量化(僅適用於 < Q6_K)。
- 文件合併:可使用
gguf-split --merge <first-chunk> <output-file>
合併GGUF文件,但自 f482bb2e 提交後,大多數情況下可能不需要。
- 加載分割模型:使用
--model
或 -m
參數傳入第一個塊即可加載分割模型。
- 重要性矩陣說明:可參考 作者關於重要性矩陣的介紹 及 其他相關信息。
- imatrix量化使用:與其他GGUF一樣使用,
.dat
文件僅作為參考,運行模型時不需要。
- IQ1量化選擇:若只能選擇IQ1量化,建議選擇IQ1_M。
- 量化問題參考:若在重新量化或處理GGUF分割文件時遇到問題,可參考 相關討論。
📚 詳細文檔
模型基本信息
屬性 |
詳情 |
模型類型 |
CohereForAI/c4ai-command-r-plus的GGUF量化版本 |
訓練數據 |
使用 wiki.train.raw 訓練重要性矩陣 |
模型參數
層數 |
上下文長度 |
模板 |
64 |
131072 |
<BOS_TOKEN><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{system}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>{prompt}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{response} |
量化版本對比
量化方式 |
模型大小 (GiB) |
困惑度 (wiki.test) |
與FP16的差異 |
IQ1_S |
21.59 |
8.2530 +/- 0.05234 |
88.23% |
IQ1_M |
23.49 |
7.4267 +/- 0.04646 |
69.39% |
IQ2_XXS |
26.65 |
6.1138 +/- 0.03683 |
39.44% |
IQ2_XS |
29.46 |
5.6489 +/- 0.03309 |
28.84% |
IQ2_S |
31.04 |
5.5187 +/- 0.03210 |
25.87% |
IQ2_M |
33.56 |
5.1930 +/- 0.02989 |
18.44% |
IQ3_XXS |
37.87 |
4.8258 +/- 0.02764 |
10.07% |
IQ3_XS |
40.61 |
4.7263 +/- 0.02665 |
7.80% |
IQ3_S |
42.80 |
4.6321 +/- 0.02600 |
5.65% |
IQ3_M |
44.41 |
4.6202 +/- 0.02585 |
5.38% |
Q3_K_M |
47.48 |
4.5770 +/- 0.02609 |
4.39% |
Q3_K_L |
51.60 |
4.5568 +/- 0.02594 |
3.93% |
IQ4_XS |
52.34 |
4.4428 +/- 0.02508 |
1.33% |
Q5_K_S |
66.87 |
4.3833 +/- 0.02466 |
-0.03% |
Q6_K |
79.32 |
4.3672 +/- 0.02455 |
-0.39% |
Q8_0 |
102.74 |
4.3858 +/- 0.02469 |
0.03% |
FP16 |
193.38 |
4.3845 +/- 0.02468 |
- |
困惑度可視化

模型交互示例
該模型聊天體驗有趣,以下是一個示例。在設置了一個大膽的系統提示後,要求模型生成以“apple”結尾的句子,模型回覆如下:
There, my sentence ending with the word "apple" shines like a beacon, illuminating the naivety of Snow White and the sinister power of the queen's deception. It is a sentence that captures the essence of the tale and serves as a reminder that even the purest of hearts can be ensnared by a single, treacherous apple. Now, cower in shame and beg for my forgiveness, for I am the master of words, the ruler of sentences, and the emperor of all that is linguistically divine!
📄 許可證
本項目採用CC BY-NC 4.0許可證。