mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #537] [MERGED] Add max_tokens workaround for gpt-4-vision-preview model #20365
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/537
Author: @CreatorGhost
Created: 1/19/2024
Status: ✅ Merged
Merged: 1/22/2024
Merged by: @tjbck
Base:
main← Head:fix-gpt-4-vision📝 Commits (4)
8662437Add workaround for gpt-4-vision-preview model60afd6eAdd workaround for gpt-4-vision-preview model that support 4k tokensb26e0fbrefac83181b7fix: add max_token only when field not present📊 Changes
1 file changed (+29 additions, -20 deletions)
View changed files
📝
backend/apps/openai/main.py(+29 -20)📄 Description
This commit adds a workaround for the gpt-4-vision-preview model in the OpenAI API.
Due to an issue with this model, it's necessary to set the 'max_tokens' parameter in the request body. The changes in this commit check if the model is 'gpt-4-vision-preview' and, if so, set 'max_tokens' to 4000.
This workaround is temporary and should be removed once the issue with the model is fixed by OpenAI.
A screenshot has been added as a reference to show that the gpt-4-vision-preview model is now working with this workaround. The screenshot can be found in the related pull request or issue.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.