在mac m3上跑llama2-7b
克隆和编译llama.cpp
git clone https://github.com/ggerganov/llama.cpp
LLAMA_METAL=1 make
生成量化版本模型
python3 -m pip install -r requirements.txt
convert the 7B model to ggml FP16 format 对FP16模型进行4-bit量化,默认做当前目录下生成ggml模型ggml-model-f16.bin
python3 ./examples/convert_legacy_llama.py models/llama-2-7b-hf/
quantize the model to 4-bits (using q4_0 method) 进一步对FP16模型进行4-bit量化