0%

llama.cpp部署Qwen模型

大模型部署工具 llama.cpp

安装

  1. clone项目
  2. mac上在项目目录执行make命令

使用模型

  1. clone模型到models文件
  2. 将模型转化为GGUF格式
    1
    2
    pip install -r requirements.txt
    python3 convert-hf-to-gguf.py models/Qwen1.5-0.5B-Chat
  3. quantize
    1
    ./quantize models/Qwen1.5-0.5B-Chat/ggml-model-f16.gguf Q8_0
  4. 使用
    1
    ./main -m ./models/Qwen1.5-0.5B-Chat/ggml-model-Q8_0.gguf -n 512 --color -i -cml -ngl 0 -f prompts/chat-with-qwen.txt

错误

  1. libc++abi: terminating due to uncaught exception of type std::out_of_range: unordered_map::at: key not found
    convert时候的--vocab-type使用错了
  2. 返回@@@@或胡乱回答
    convert的时候使用convert-hf-to-gguf.py