mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 05:24:02 +00:00
Merge pull request #5710 from kivvi3412/fix_o1_max_tokens
Fix: o1 input parameter must be max_completion_tokens
This commit is contained in:
commit
cc19b8049a
@ -415,6 +415,9 @@ async def generate_chat_completion(
|
|||||||
payload["max_tokens"] = payload["max_completion_tokens"]
|
payload["max_tokens"] = payload["max_completion_tokens"]
|
||||||
del payload["max_completion_tokens"]
|
del payload["max_completion_tokens"]
|
||||||
else:
|
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:
|
if "max_tokens" in payload and "max_completion_tokens" in payload:
|
||||||
del payload["max_tokens"]
|
del payload["max_tokens"]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user