Telechat.cpp
telechat.cpp项目是Telechat大模型的c++版本,使用ggml库编写,支持ggml模型转换、so库的python工程化应用。当前支持Telechat-7B、Telechat-11B模型。
ggml模型转换
python3 tokenizerjsonto_model.py
配置convert.py中的原始模型路径、lora模型路径、转换ggml模型路径,运行命令:
python3 convert.py
编译
编译环境
Ubuntu 22.04
gcc 11.4.0
g++ 11.4.0
make 4.3
cmake 3.22.1
cuda 11.7 12.2
CPU编译
cmake -B build
cmake --build build -j --config Release
编译GPU
cmake -B build -DGGML_CUBLAS=ON && cmake --build build -j --config Release
推理
支持用户自定义prompt文件和配置文件。
运行telechatlib.so进行端到端推理:
python3 test_so.py
运行命令行进行端到端推理:
bash test_cli.sh
评论