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
83181b79
Commit
83181b79
authored
Jan 22, 2024
by
Timothy J. Baek
Browse files
fix: add max_token only when field not present
parent
b26e0fb7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
backend/apps/openai/main.py
backend/apps/openai/main.py
+2
-1
No files found.
backend/apps/openai/main.py
View file @
83181b79
...
...
@@ -87,6 +87,7 @@ async def proxy(path: str, request: Request, user=Depends(get_current_user)):
# Check if the model is "gpt-4-vision-preview" and set "max_tokens" to 4000
# This is a workaround until OpenAI fixes the issue with this model
if
body
.
get
(
"model"
)
==
"gpt-4-vision-preview"
:
if
"max_tokens"
not
in
body
:
body
[
"max_tokens"
]
=
4000
print
(
"Modified body_dict:"
,
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