remove empty stream response

This commit is contained in:
hiyouga
2024-05-04 16:13:52 +08:00
parent 941924fdbd
commit e984ba3167

View File

@@ -156,6 +156,7 @@ async def create_stream_chat_completion_response(
top_p=request.top_p,
max_new_tokens=request.max_tokens,
):
if len(new_token) != 0:
yield _create_stream_chat_completion_chunk(
completion_id=completion_id, model=request.model, delta=ChatCompletionMessage(content=new_token)
)