Skip to content

Commit

Permalink
stable api_server benchmark result by a non-zero await (#885)
Browse files Browse the repository at this point in the history
* stable api_server benchmark result by a non-zero await

* move to beginning of the loop
  • Loading branch information
AllentDan authored Dec 25, 2023
1 parent 174474a commit e84e99a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lmdeploy/turbomind/turbomind.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ async def async_stream_infer(self,
# Thanks for https://github.com/frankxyy and his issue
# https://github.com/InternLM/lmdeploy/issues/832
while self.que.qsize() == 0:
await asyncio.sleep(0)
await asyncio.sleep(0.002) # sleep(0) makes server unstable

while self.que.qsize() > 1:
self.que.get()

Expand Down

0 comments on commit e84e99a

Please sign in to comment.