[BugFix] fix max streaming tokens invalid (#3774)

* Update serving_chat.py

* Update serving_completion.py
This commit is contained in:
ltd0924
2025-09-02 21:00:29 +08:00
committed by GitHub
parent 121ac85d7d
commit c5591c45df
2 changed files with 0 additions and 9 deletions

View File

@@ -298,11 +298,6 @@ class OpenAIServingChat:
api_server_logger.info(f"Chat Streaming response last send: {chunk.model_dump_json()}")
choices = []
if choices:
chunk.choices = choices
yield f"data: {chunk.model_dump_json(exclude_unset=True)}\n\n"
choices = []
if include_usage:
completion_tokens = previous_num_tokens
usage = UsageInfo(

View File

@@ -352,10 +352,6 @@ class OpenAIServingCompletion:
)
yield f"data: {usage_chunk.model_dump_json(exclude_unset=True)}\n\n"
api_server_logger.info(f"Completion Streaming response last send: {chunk.model_dump_json()}")
if choices:
chunk.choices = choices
yield f"data: {chunk.model_dump_json(exclude_unset=True)}\n\n"
choices = []
except Exception as e:
yield f"data: {ErrorResponse(message=str(e), code=400).model_dump_json(exclude_unset=True)}\n\n"