Skip to content

Commit

Permalink
Fix OpenAISpec with continuous batching loop (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketmaurya authored Dec 16, 2024
1 parent ca9d8c9 commit e71f38b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/litserve/loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def add_request(self, uid: str, request: Any, lit_api: LitAPI, lit_spec: Optiona

def mark_completed(self, uid: str) -> None:
"""Mark a request as completed and remove it from the tracked state."""
logger.info(f"Marking sequence {uid} as completed")
logger.debug(f"Marking sequence {uid} as completed")
del self.active_sequences[uid]
del self.response_queue_ids[uid]

Expand Down Expand Up @@ -839,7 +839,7 @@ def prefill(
if new_batches:
# Add new requests to pending_requests and try to process them
for response_queue_id, uid, input in new_batches:
logger.info(f"New request: {uid}, {input}")
logger.debug(f"New request: {uid}, {input}")
if self.has_capacity(lit_api):
self.add_request(uid, input, lit_api, lit_spec)
self.response_queue_ids[uid] = response_queue_id
Expand Down Expand Up @@ -892,6 +892,7 @@ def run(
uid = step_output.uid
response_queue_id = self.response_queue_ids[uid]

response_data = lit_api.format_encoded_response(response_data)
if status == LitAPIStatus.ERROR:
self.put_error_response(response_queues, response_queue_id, uid, response_data)
self.mark_completed(uid)
Expand Down

0 comments on commit e71f38b

Please sign in to comment.