mirror of
https://github.com/open-webui/open-webui
synced 2024-11-22 08:07:55 +00:00
Fix: o1 input parameter must be max_completion_tokens
This commit is contained in:
parent
e268ee5675
commit
405d0561df
@ -415,6 +415,9 @@ async def generate_chat_completion(
|
||||
payload["max_tokens"] = payload["max_completion_tokens"]
|
||||
del payload["max_completion_tokens"]
|
||||
else:
|
||||
if payload["model"].lower().startswith("o1-") and "max_tokens" in payload:
|
||||
payload["max_completion_tokens"] = payload["max_tokens"]
|
||||
del payload["max_tokens"]
|
||||
if "max_tokens" in payload and "max_completion_tokens" in payload:
|
||||
del payload["max_tokens"]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user