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

修复api接口websocket的伪流式输出 #628

Merged
merged 1 commit into from
Jul 2, 2023

Conversation

zzxs
Copy link
Contributor

@zzxs zzxs commented Jun 14, 2023

不清楚是不是因为websocket的问题。

在使用postman连接ws接口时,虽然发送的信息还是流式的,但是并不实时,获取推理结果时会最后一起拿到几十条。

因此在流式推理结果send前添加sleep,类似于nextTick这样的操作,使得推理结果会实时返回,达到真流式输出的结果。

修复后,经测试,postman可以顺畅的实时接受流式结果。

修复websocket的伪流式输出
@zzxs zzxs changed the title Update api.py 修复websocket的伪流式输出 Jun 15, 2023
@zzxs zzxs changed the title 修复websocket的伪流式输出 修复api接口websocket的伪流式输出 Jun 15, 2023
@earthxx
Copy link

earthxx commented Jun 25, 2023

太棒了 搞了两天 才发现是这里的问题

@imClumsyPanda imClumsyPanda merged commit 6ab496e into chatchat-space:master Jul 2, 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.

None yet

3 participants