fix(grpc): send last chunk before completion during streaming (#19895)
This commit is contained in:
@@ -227,12 +227,17 @@ class SGLangSchedulerServicer(sglang_scheduler_pb2_grpc.SglangSchedulerServicer)
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
elif output.get("finished", False):
|
elif request.stream:
|
||||||
|
yield self._create_chunk_response(request.request_id, output)
|
||||||
|
if output.get("finished", False):
|
||||||
yield self._create_completion_response(
|
yield self._create_completion_response(
|
||||||
request.request_id, output
|
request.request_id, output
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
yield self._create_chunk_response(request.request_id, output)
|
# Non-streaming n=1: single completion response
|
||||||
|
yield self._create_completion_response(
|
||||||
|
request.request_id, output
|
||||||
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|||||||
Reference in New Issue
Block a user