基於 Llama 2 模型微調,以提升中文對話能力。

7b 13b

146K 15 個月前

Readme

Llama 2 對話中文微調參數模型

這個模型是基於 Meta Platform, Inc. 所發布的 Llama 2 Chat 開源模型進行微調。根據 Meta 提供的資訊,Llama 2 的訓練資料量達到兩兆個 tokens,上下文長度也提升至 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 https://127.0.0.1:11434/api/generate -d '{
  "model": "llama2-chinese:7b-chat-q4_0",
  "prompt":"为什么天空是蓝色的"
 }'

記憶體需求

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

參考資料

FlagAlpha

FlagAlpha