add support for Deepseek R1 model and display CoT #2118
+71
−53
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.
添加了 Deepseek R1 模型的支持,并会展示思维链。
对代码的改动如下(主要是修改了
oai_std_model_template.py
):decode_chunk()
函数:Deepseek 在返回思维链内容时会将内容设置为空,这里增加了特殊处理避免将 None 和字符串拼接而报错。predict()
和predict_no_ui_long_connection()
函数,支持显示 CoT。这里将 CoT 将以 blockquote 的方式包裹。维护者可以考虑的建议:
Solve #2117