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