[Bugfix] Return HTTP 400 instead of 501 for unknown chat roles in DeepSeek encoders (#53071)
Signed-off-by: JC-ut0 <809602657@qq.com>
This commit is contained in:
@@ -353,7 +353,7 @@ def render_message(
|
||||
tool_calls=tc_content,
|
||||
)
|
||||
else:
|
||||
raise NotImplementedError(f"Unknown role: {role}")
|
||||
raise ValueError(f"Invalid role: {role}")
|
||||
|
||||
# Append transition tokens based on what follows
|
||||
if index + 1 < len(messages) and messages[index + 1].get("role") not in ["assistant", "latest_reminder"]:
|
||||
|
||||
Reference in New Issue
Block a user