mirror of
https://github.com/open-webui/open-webui
synced 2024-11-17 22:12:51 +00:00
refac: unnecessary max_token value removed
This commit is contained in:
parent
bbeaa92904
commit
781be2779b
@ -147,13 +147,11 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
|
|||||||
print("Modified body_dict:", body)
|
print("Modified body_dict:", body)
|
||||||
|
|
||||||
# Fix for ChatGPT calls failing because the num_ctx key is in body
|
# Fix for ChatGPT calls failing because the num_ctx key is in body
|
||||||
if 'num_ctx' in body:
|
if "num_ctx" in body:
|
||||||
# If 'num_ctx' is in the dictionary, delete it
|
# If 'num_ctx' is in the dictionary, delete it
|
||||||
# Leaving it there generates an error with the
|
# Leaving it there generates an error with the
|
||||||
# OpenAI API (Feb 2024)
|
# OpenAI API (Feb 2024)
|
||||||
del body['num_ctx']
|
del body["num_ctx"]
|
||||||
# OpenAI API (Feb 2024) accepts max_tokens
|
|
||||||
body["max_tokens"] = 1600
|
|
||||||
|
|
||||||
# Convert the modified body back to JSON
|
# Convert the modified body back to JSON
|
||||||
body = json.dumps(body)
|
body = json.dumps(body)
|
||||||
|
Loading…
Reference in New Issue
Block a user