pip install transformers
借助bitsandbytes直接量化4bit模型。
我们为Gemma 2(9B) 准备了Google Colab Tesla T4笔记本:https://colab.research.google.com/drive/1vIrqH5uYDQwsJ4-OO3DErvuv4pBgVwk4?usp=sharing
所有笔记本都对初学者友好!添加您的数据集,点击“全部运行”,您将获得一个速度提升2倍的微调模型,该模型可导出为GGUF、vLLM格式。
| Unsloth支持的模型 | 免费笔记本 | 性能提升 | 内存占用减少 |
|---|---|---|---|
| Llama 3 (8B) | ▶️ 在Colab上开始 | 2.4倍 | 58% |
| Gemma 2 (9B) | ▶️ 在Colab上开始 | 2倍 | 63% |
| Mistral (9B) | ▶️ 在Colab上开始 | 2.2倍 | 62% |
| Phi 3 (mini) | ▶️ 在Colab上开始 | 2倍 | 63% |
| TinyLlama | ▶️ 在Colab上开始 | 3.9倍 | 74% |
| CodeLlama (34B) A100 | ▶️ 在Colab上开始 | 1.9倍 | 27% |
| Mistral (7B) 1xT4 | ▶️ 在Kaggle上开始 | 5倍* | 62% |
| DPO - Zephyr | ▶️ 在Colab上开始 | 1.9倍 | 19% |