Skip to content

Commit dbd0b3c

Browse files
committed
fix: remove <|im_end|> returned by llama-server api.
1 parent fc8464c commit dbd0b3c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mineru_vl_utils/vlm_client/http_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ def get_response_content(self, response_data: dict) -> str:
275275
content = message["content"]
276276
if not (content is None or isinstance(content, str)):
277277
raise ServerError(f"Unexpected content type: {type(content)}.")
278+
if isinstance(content, str) and content.endswith('<|im_end|>'):
279+
content = content[:-10]
278280
return content or ""
279281

280282
def predict(

0 commit comments

Comments
 (0)