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

Update api.py 同步方法异步化,防止请求之间在服务层相互阻塞,增加api调用的并发性能 #1340

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aleimu
Copy link

@aleimu aleimu commented Jul 18, 2023

同步方法异步化,防止请求之间在服务层相互阻塞,增加api调用的并发性能

同步方法异步化,增加api调用的并发性能,防止请求之间在服务层相互阻塞
简洁一些,用库里的函数to_thread
@aleimu aleimu closed this Jul 18, 2023
@aleimu aleimu reopened this Jul 18, 2023
@Zimo777
Copy link

Zimo777 commented Aug 30, 2023

大佬,想问下如何实现多用户并发的

@aleimu
Copy link
Author

aleimu commented Aug 31, 2023

大佬,想问下如何实现多用户并发的

模型本身是支持异步输出的,只是代码示例中的不使用流式输出的api接口会阻塞其他请求,具体你可以看看python的异步特性

@Zimo777
Copy link

Zimo777 commented Aug 31, 2023

大佬,想问下如何实现多用户并发的

模型本身是支持异步输出的,只是代码示例中的不使用流式输出的api接口会阻塞其他请求,具体你可以看看python的异步特性

好的感谢

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

2 participants