You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. I have searched related issues but cannot get the expected help.
2. The bug has not been fixed in the latest version.
3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
{"id":"1","object":"chat.completion","created":1734435379,"model":"glm-4v-9b","choices":[{"index":0,"message":{"role":"assistant","content":"(preview) is a pattern","tool_calls":null},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":1647,"total_tokens":1653,"completion_tokens":6}}
Checklist
Describe the bug
用加模板的方式启用:
lmdeploy serve api_server --eager-mode /home/nfs/appnfs/sxh/pre_models/ZhipuAI/glm-4v-9b --backend pytorch --model-name glm-4v-9b --device ascend --tp 2 --chat-template /opt/lmdeploy/chat_template/glm-4v.json --server-name 0.0.0.0 --server-port 50055
生成为空或乱码
过程以及错误结果如下:
curl "http://192.168.1.49:50055/v1/chat/completions" -H "Content-Type: application/json" -d '{
"model": "glm-4v-9b",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "描述这张图片"},
{ "type": "image_url", "image_url": { "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAIAAAAa4xgvAAAACXBIWXMAABJ0AAASdAHeZh94AAAAEXRFWHRTb2Z0d2FyZQBTbmlwYXN0ZV0Xzt0AAAGDSURBVEiJ7ZZNboJAFMefxnMIsvQAphtkgQt7AxIJLMzEnoGkLtqEM2gIi6oLjsACmkC78hBWepHpYuwEBuTDjNSk/sJiPvnPe3nvzXSG4wdoGQwA0GtZj9JtTzjLnwlzdTWuXkK5u7oZTXzLwFrsrVykG2dlmO+XyVjZ++HeD721W1O4zGJv5UqCWDgVxJFlv9jWcjJWyMhoqtJD2NaycH1dYe1pnu6imaHKirbIDDq7N2e3ye+l5wAApBuDPmtAj86hmUnakiCS9uhRhatxEna2G2e7AQBv7YYfUaERfLm9dPLWrmW/HpJj+X6km0g3aTeIo/fP6EJh8i9tMa9UhaLgonFeV5jmxrlA5UuXqn59H0dTtY6VXDhZzGR3C/CMakkQ65fMLlN1L4PUatt6ZuoaQZWz4YYBcJPbadAXD0nC6AEoSDeDOErXSMLeD2k7f6CTcNpL6UWM95j9JGuDuDhx80dJ0xnKnJ+35HYqU8XXEa4GA/zHN9ft3U6XcH9Xl/ED3BKQRuI2xpEAAAAASUVORK5CYII="}}
]
}
],
"max_tokens": 128,
"stream": false
}'
{"id":"1","object":"chat.completion","created":1734435379,"model":"glm-4v-9b","choices":[{"index":0,"message":{"role":"assistant","content":"(preview) is a pattern","tool_calls":null},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":1647,"total_tokens":1653,"completion_tokens":6}}
内容有时候还会生成:“,,,,,,)))))))),,,,,”类似这种不正常的输出
不加模板启动生成是正常的,但是如果我用k8s调用的话必须要求传模板
我的json模板如下:
{
"model_name": "glm-4v-9b",
"system": "<|vision_start|>system\n",
"meta_instruction": "你是一个名为 GLM-4 的人工智能助手。你是基于智谱AI训练的语言模型 GLM-4 模型开发的,你的任务是针对用户的问题和要求提供适当的答复和支持。",
"eosys": "<|vision_end|>\n",
"user": "<|vision_start|>user\n",
"eoh": "<|vision_end|>\n",
"assistant": "<|vision_start|>assistant\n",
"eoa": "<|vision_end|>",
"separator": "\n",
"capability": "chat",
"stop_words": ["<|vision_end|>"]
}
Reproduction
lmdeploy serve api_server
--eager-mode /home/nfs/appnfs/xxx/pre_models/ZhipuAI/glm-4v-9b
--backend pytorch
--model-name glm-4v-9b
--device ascend
--tp 2
--chat-template /opt/lmdeploy/chat_template/glm-4v.json
--server-name 0.0.0.0
--server-port 50055
Environment
Error traceback
No response
The text was updated successfully, but these errors were encountered: