Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
781be277
"src/vscode:/vscode.git/clone" did not exist on "83a900bd4a5152402c37fa6cc628a5f6e8cf8019"
Commit
781be277
authored
Feb 27, 2024
by
Timothy J. Baek
Browse files
refac: unnecessary max_token value removed
parent
bbeaa929
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
backend/apps/openai/main.py
backend/apps/openai/main.py
+2
-4
No files found.
backend/apps/openai/main.py
View file @
781be277
...
...
@@ -147,13 +147,11 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
print
(
"Modified body_dict:"
,
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
# Leaving it there generates an error with the
# OpenAI API (Feb 2024)
del
body
[
'num_ctx'
]
# OpenAI API (Feb 2024) accepts max_tokens
body
[
"max_tokens"
]
=
1600
del
body
[
"num_ctx"
]
# Convert the modified body back to JSON
body
=
json
.
dumps
(
body
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment