1、Release模式
git clone --recursive https://github.com/QwenLM/qwen.cpp && cd qwen.cpp
git submodule update --init --recursive
python3 qwen_cpp/convert.py -i /mnt/workspace/qwen.cpp/Qianwen/qwen/Qwen-7B-Chat -t q4_0 -o qwen7b-ggml.bincmake -B build
cmake --build build -j --config Release
./build/bin/main -m ./qwen7b-ggml.bin --tiktoken /mnt/workspace/qwen.cpp/Qianwen/qwen/Qwen-7B-Chat/qwen.tiktoken -p 你好
2、Debug模式
將CMakeLists.txt的Release改成Debug
if (NOT CMAKE_BUILD_TYPE)set(CMAKE_BUILD_TYPE Debug)
endif ()
cmake --build build -j --config Bebug
gdb ./build/bin/main
問題:
https://github.com/QwenLM/qwen.cpp/pull/40
139行assert中的!=應改為==,否則在debug模式下無法正常運行
3、llama2.c運行llama2時export.py問題
export1.py
https://github.com/karpathy/llama2.c/blob/de005474d37d0cde1356739b8c79ebe7b42b5973/export_meta_llama_bin.py