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
Return a string to describe about the finish reason.
Related to #130
Due to in codebase there exists the usage like
```
req.aborted and req.req_status == ReqRunStatus.WAIT_IN_QUEUE
```
It is not suitable to merge `ReqRunStatus` and `FinishStatus`, so I
separate an individual class to indicate the finish reason.
---------
Co-authored-by: hiworldwzj <[email protected]>
Issue description:
感觉目前的实现跟openai标准的输出的不太一样:
Steps to reproduce:
请求示例:
{
"model": "Qwen",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"stream":true,
"top_p":0.7,
"presence_penalty":1.2,
"max_tokens":512
}
返回示例:
data: {"id": "chatcmpl-e93674ffedbb465e9ac7d3b503e29f13", "object": "chat.completion.chunk", "created": 1694575540, "model": "Qwen", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "你好"}, "finish_reason": null}]}
data: {"id": "chatcmpl-e93674ffedbb465e9ac7d3b503e29f13", "object": "chat.completion.chunk", "created": 1694575540, "model": "Qwen", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "!"}, "finish_reason": null}]}
data: {"id": "chatcmpl-e93674ffedbb465e9ac7d3b503e29f13", "object": "chat.completion.chunk", "created": 1694575540, "model": "Qwen", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "很高兴"}, "finish_reason": null}]}
data: {"id": "chatcmpl-e93674ffedbb465e9ac7d3b503e29f13", "object": "chat.completion.chunk", "created": 1694575540, "model": "Qwen", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "为你"}, "finish_reason": null}]}
data: {"id": "chatcmpl-e93674ffedbb465e9ac7d3b503e29f13", "object": "chat.completion.chunk", "created": 1694575540, "model": "Qwen", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "提供"}, "finish_reason": null}]}
data: {"id": "chatcmpl-e93674ffedbb465e9ac7d3b503e29f13", "object": "chat.completion.chunk", "created": 1694575540, "model": "Qwen", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "帮助"}, "finish_reason": null}]}
data: {"id": "chatcmpl-e93674ffedbb465e9ac7d3b503e29f13", "object": "chat.completion.chunk", "created": 1694575540, "model": "Qwen", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "。"}, "finish_reason": null}]}
data: {"id": "chatcmpl-e93674ffedbb465e9ac7d3b503e29f13", "object": "chat.completion.chunk", "created": 1694575540, "model": "Qwen", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "<|im_end|>"}, "finish_reason": null}]}
Expected behavior:
感觉openai接口的功能还没有很完善,后续还会有继续更新的计划吗?
The text was updated successfully, but these errors were encountered: