Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketmaurya committed Dec 19, 2024
1 parent 8eb7f19 commit b5ff91a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/litserve/loops/continuous_batching_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ async def run_in_background(
try:
pending_requests = []
while True:
await asyncio.sleep(0.001)
pending_requests = await self.prefill(
pending_requests,
lit_api,
Expand All @@ -167,6 +166,7 @@ async def run_in_background(
batch_timeout,
response_queues,
)
await asyncio.sleep(0)
except Exception as e:
logger.exception("An error occurred in run_in_background: %s", e)
finally:
Expand Down Expand Up @@ -194,7 +194,7 @@ async def run(
"""Main loop that processes batches of requests."""
try:
prev_outputs = None
while await lit_api.has_active_requests():
while lit_api.has_active_requests():
# Process one step for all active sequences
responses = await self.step(prev_outputs, lit_api, lit_spec)
if len(responses) == 0:
Expand Down
2 changes: 1 addition & 1 deletion src/litserve/loops/loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ async def _wrapper():
workers_setup_status,
callback_runner,
)
await asyncio.sleep(0.00001)
await asyncio.sleep(0)
except Exception as e:
logger.exception("An error occurred in the loop: %s", e)
# Optionally, break the loop or handle the error as needed
Expand Down

0 comments on commit b5ff91a

Please sign in to comment.