songquanpeng / one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
https://openai.justsong.cn/
MIT License
18.55k stars 4.19k forks source link

OneAPI调用本地qwen模型时,stream为true时,请求无返回信息。 #1712

Closed ne0ke718 closed 2 months ago

ne0ke718 commented 2 months ago

例行检查

问题描述 oneapi调用的本地qwen1.5-32B模型。当 "stream": true,配置时,会没有任何返回信息。请求oneapi的请求为: curl --location --request POST 'http://192.168.100.34:3001/v1/chat/completions' --header 'Authorization: Bearer sk-fastgpt' --header 'Content-Type: application/json' --data-raw '{ "model": "qwen1half-32b-chat", "stream": true, "temperature": 1, "max_tokens": 3000, "messages": [ { "role": "user", "content": "你是谁" } ] }'

响应如下: image

但,如果把curl中的api地址和ak换成本地大模型的接口,则一切正常,无论"stream": true,或者false,都正常回复。 试了多个版本,包括最新版本:v0.6.8-alpha.6 都问题依然存在。

复现步骤

预期结果

ne0ke718 commented 2 months ago

关闭吧。我通过xinference发布本地微调后的模型,走xinference的api,解了这个问题。