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

fix: openai_api 的 stream api,服务端全部生成文本后客户端才一次性收到 #152

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

mougua
Copy link
Contributor

@mougua mougua commented Jul 2, 2023

不知道是不是我个例,openai_api.py 里面的 create_chat_completion 方法,stream=True 的时候没能有“流式”效果。所以用 sse_starlette.sse 改写了一下。

另外在predict函数末尾加上yield '[DONE]',有些openai的客户端才能识别到“结束”

@duzx16 duzx16 changed the base branch from main to dev July 4, 2023 04:06
@duzx16 duzx16 changed the base branch from dev to dev_api July 4, 2023 04:06
@duzx16 duzx16 merged commit b99e3d7 into THUDM:dev_api Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants