[BugFix] fix messages being inplace modified in offline chat api (#4830)
CE Compile Job / ce_job_pre_check (push) Has been cancelled
CE Compile Job / print_ce_job_pre_check_outputs (push) Has been cancelled
CE Compile Job / FD-Clone-Linux (push) Has been cancelled
CE Compile Job / Show Code Archive Output (push) Has been cancelled
CE Compile Job / BUILD_SM8090 (push) Has been cancelled
CE Compile Job / BUILD_SM8689 (push) Has been cancelled
CE Compile Job / CE_UPLOAD (push) Has been cancelled

This commit is contained in:
李泳桦
2025-11-05 20:46:55 +08:00
committed by GitHub
parent 1689f7ef86
commit 7e7a91855b
+2 -4
View File
@@ -252,11 +252,9 @@ class LLM:
validated_tools = self._validate_tools(tools)
except ValueError as e:
raise RuntimeError(f"Failed to validate 'tools' parameter in chat method: {e}") from e
messages_len = len(messages)
for i in range(messages_len):
messages[i] = {"messages": messages[i]}
req_ids = self._add_request(
prompts=messages,
prompts=[{"messages": msg} for msg in messages],
sampling_params=sampling_params,
chat_template_kwargs=chat_template_kwargs,
chat_template=chat_template,