Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeepSeek 流式输出最后记录 role = null #1429

Open
5 tasks done
yttchan opened this issue May 13, 2024 · 2 comments
Open
5 tasks done

DeepSeek 流式输出最后记录 role = null #1429

yttchan opened this issue May 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@yttchan
Copy link

yttchan commented May 13, 2024

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,尤其是常见问题部分
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述

DeepSeek 流式输出最后记录 role = null

官方api 输出:
{
    "id": "c71316c0-c2ff-4702-8e29-b201dffbf084",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "",
                "role": null
            },
            "finish_reason": "stop",
            "logprobs": null
        }
    ],
    "created": 1715574938,
    "model": "deepseek-chat",
    "system_fingerprint": null,
    "object": "chat.completion.chunk",
    "usage": {
        "prompt_tokens": 10,
        "completion_tokens": 37,
        "total_tokens": 47
    }
}
one-api 输出:
{
    "id": "f6b7c79f-0bc5-46b4-8865-572e04d78675",
    "choices": [
        {
            "index": 0,
            "delta": {
                "content": "",
                "role": null
            },
            "finish_reason": "stop",
            "logprobs": null
        }
    ],
    "created": 1715571416,
    "model": "deepseek-chat",
    "system_fingerprint": null,
    "object": "chat.completion.chunk",
    "usage": {
        "prompt_tokens": 10,
        "completion_tokens": 52,
        "total_tokens": 62
    }
}

预期结果

虽然官方api输出的也是role = null , 希望oneapi 可以处理最后一条消息,正常输出 “assistant”

@yttchan yttchan added the bug Something isn't working label May 13, 2024
@yooohk333
Copy link

同样问题,楼主有微信吗

@RexWzh
Copy link

RexWzh commented May 14, 2024

这类问题。。。应该去和 speedchat 反馈更合适 🤣

https://github.com/deepseek-ai/DeepSeek-V2


当结尾 "finish_reason":"stop" 时,role 值为空。

data: {"id":"2c0e9145-0ef9-4037-a5b0-590c6df994b0","choices":[{"index":0,"delta":{"content":".","role":"assistant"},"finish_reason":null,"logprobs":null}],"created":1715667871,"model":"deepseek-chat","system_fingerprint":null,"object":"chat.completion.chunk"}

data: {"id":"2c0e9145-0ef9-4037-a5b0-590c6df994b0","choices":[{"index":0,"delta":{"content":"","role":null},"finish_reason":"stop","logprobs":null}],"created":1715667871,"model":"deepseek-chat","system_fingerprint":null,"object":"chat.completion.chunk","usage":{"prompt_tokens":8,"completion_tokens":27,"total_tokens":35}}

你其实可以补充说一下,用什么框架或代码,因为这个报错了。


同样问题,楼主有微信吗

@yooohk333 你如果有偿还好说,开源项目用爱发电,500个 issue 都去找本人不得崩了(

不过,说来,如果有交流群或电报群之类就好了~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants