🚀 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许可证。