fix: Qwen 模型无法正确适配 & 修复同步模式下 openai 流式输出问题 #287
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
此 PR 解决 issue #286
Qwen 模型无法正确适配
通义千问大语言模型有兼容 OpenAI 数据输出格式的 API 的接口(除 通义千问Audio 外),原 Qwen 模型适配代码误将官方提供的 DashScope 格式混淆了。此处进行修改,将 gpt 与 qwen 的接口调用部分并列。
修复同步模式下 openai 流式输出问题
在
model_cli_demo.py
文件中展示了本地大语言模型流式输出的示例,但是对于 OpenAI 形式的远程调用的大语言模型无法正确处理同步模式下的 streaming chat (流式聊天),经过排查是在同步模式请求下的 requests.post 忘记添加 stream=True 导致的。杂项
其余说明
对于项目 MindSearch 中的 Qwen 模型 API 地址需要修改,修改后的版本在测试时通过。
晚些提交 MindSearch 的 PR。