基于 Llama 2 模型微调,以提升中文对话能力。

7b 13b

146K 15 个月前

Readme

Llama 2 对话中文微调参数模型

这个模型是基于 Meta Platform, Inc. 所发布的 Llama 2 Chat 开源模型来进行微调。根据 Meta 的数据,Llama 2 的训练数据达到了两万亿个 token,上下文长度也提升到 4096。对话方面也使用了 100 万人工标记的数据进行微调。

由于 Llama 2 本身的中文对齐能力较弱,开发者采用了中文指令集来进行微调,以使其具备更强的中文对话能力。目前这个中文微调参数模型总共发布了 7B 和 13B 两种参数大小。

Llama 2 chat chinese fine-tuned model

This model is fine-tuned based on Meta Platform’s Llama 2 Chat open source model. According to Meta, Llama 2 is trained on 2 trillion tokens, and the context length is increased to 4096. The chat model is fine-tuned using 1 million human labeled data.

Since the Chinese alignment of Llama 2 itself is relatively weak, the developer, adopted a Chinese instruction set for fine-tuning to improve the Chinese dialogue ability.

The Chinese fine-tuned models are available in 7B and 13B parameter sizes.

CLI

打开终端并运行 ollama run llama2-chinese

API

运行模型

curl -X POST http://127.0.0.1:11434/api/generate -d '{
  "model": "llama2-chinese:7b-chat-q4_0",
  "prompt":"为什么天空是蓝色的"
 }'

内存需求

  • 7b 模型通常至少需要 8GB 的 RAM
  • 13b 模型通常至少需要 16GB 的 RAM

参考

FlagAlpha

FlagAlpha