li-plus / chatglm.cpp

C++ implementation of ChatGLM-6B & ChatGLM2-6B & ChatGLM3 & GLM4
MIT License
2.81k stars 327 forks source link

chatglm.cpp:152 check failed (messages.size() % 2 == 1) invalid chat messages size 2 #295

Closed zhuwensi closed 2 months ago

zhuwensi commented 2 months ago
./build/bin/main -m chatglm-ggml.bin --top_p 0.8 --temp 0.8 --sp examples/system/code_interpreter.txt -i
System   > 你是一位智能AI助手,你叫ChatGLM,你连接着一台电脑,但请注意不能联网。.......
Prompt   > 列出100以内的所有质数
ChatGLM2 > /root/ai2/chatglm.cpp/chatglm.cpp:152 check failed (messages.size() % 2 == 1) invalid chat messages size 2

Is this a bug? I tried example function and code_interpreter, and they both gave above errors.

li-plus commented 2 months ago

ChatGLM2 doesn't support system prompt. Please use ChatGLM3 for system prompt. Will fix this.

li-plus commented 2 months ago

Fixed in #292. Now system prompt is ignored for models without system prompt support. Will not throw an error.