Merge pull request #10617 from grandtele/fix/openai-o1-o3-role
Some checks are pending
Deploy to HuggingFace Spaces / check-secret (push) Waiting to run
Deploy to HuggingFace Spaces / deploy (push) Blocked by required conditions
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Waiting to run
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Waiting to run
Create and publish Docker images with specific build args / merge-main-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-cuda-images (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge-ollama-images (push) Blocked by required conditions
Python CI / Format Backend (3.11) (push) Waiting to run
Frontend Build / Format & Build Frontend (push) Waiting to run
Frontend Build / Frontend Unit Tests (push) Waiting to run

fix: replace "system" with "developer" for o1 and o3 models
This commit is contained in:
Timothy Jaeryang Baek 2025-02-23 22:33:59 -08:00 committed by GitHub
commit 0ba45ad82b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,9 +84,9 @@ def openai_o1_o3_handler(payload):
payload["max_completion_tokens"] = payload["max_tokens"]
del payload["max_tokens"]
# Fix: O1 does not support the "system" parameter, Modify "system" to "user"
# Fix: o1 and o3 do not support the "system" parameter. Modify "system" to "developer"
if payload["messages"][0]["role"] == "system":
payload["messages"][0]["role"] = "user"
payload["messages"][0]["role"] = "developer"
return payload