[bugfix][main]fix proxy decode bug (#3750)

### What this PR does / why we need it?

fix proxy decode bug when parsing non-UTF-8 characters.

- vLLM version: v0.11.0
- vLLM main:
https://github.com/vllm-project/vllm/commit/c9461e05a4ed3557cfbf4b15ded1e26761cc39ca

---------

Signed-off-by: CHEN <116010019@link.cuhk.edu.cn>
This commit is contained in:
Shirley125 authored and GitHub committed 2025-10-27 16:56:09 +08:00
1 parent b8796b06c8
commit d8ca7fee75
2 files changed
+14 -2

No files matched your search

@@ -556,7 +556,13 @@ async def _handle_completions(api: str, request: Request):
instance_info.prefiller_idx,
instance_info.prefiller_score)
released_kv = True
chunk_str = chunk.decode("utf-8").strip()
try:
chunk_str = chunk.decode("utf-8").strip()
except UnicodeDecodeError:
logger.debug(
f"Skipping chunk: {chunk}")
yield chunk
continue
if not chunk_str:
continue
if chunk_str.startswith("data: "):
@@ -539,7 +539,13 @@ async def _handle_completions(api: str, request: Request):
instance_info.prefiller_idx,
instance_info.prefiller_score)
released_kv = True
chunk_str = chunk.decode("utf-8").strip()
try:
chunk_str = chunk.decode("utf-8").strip()
except UnicodeDecodeError:
logger.debug(
f"Skipping chunk: {chunk}")
yield chunk
continue
if not chunk_str:
continue
if chunk_str.startswith("data: "):