Skip to content

Commit

Permalink
fix: adds aligned hooks back
Browse files Browse the repository at this point in the history
  • Loading branch information
bhimrazy committed Jan 13, 2025
1 parent c33c326 commit 37679c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/litserve/loops/streaming_loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def run_streaming_loop(
)
callback_runner.trigger_event(EventTypes.AFTER_PREDICT, lit_api=lit_api)

callback_runner.trigger_event(EventTypes.BEFORE_ENCODE_RESPONSE, lit_api=lit_api)
y_enc_gen = _inject_context(
context,
lit_api.encode_response,
Expand All @@ -84,6 +85,9 @@ def run_streaming_loop(
self.put_response(response_queues, response_queue_id, uid, y_enc, LitAPIStatus.OK)
self.put_response(response_queues, response_queue_id, uid, "", LitAPIStatus.FINISH_STREAMING)

callback_runner.trigger_event(EventTypes.AFTER_PREDICT, lit_api=lit_api)
callback_runner.trigger_event(EventTypes.AFTER_ENCODE_RESPONSE, lit_api=lit_api)

except HTTPException as e:
self.put_response(
response_queues,
Expand Down

0 comments on commit 37679c4

Please sign in to comment.