-
Notifications
You must be signed in to change notification settings - Fork 61k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add a method to detect vision model #4310
fix: add a method to detect vision model #4310
Conversation
@wayoungofustc is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
Your build has completed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid to using ||
that complexity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now looks better plus easy maintain unlike complexity using ||
I apologize for my oversight in not properly handling the empty strings. Now maybe this pr is ready to be merged. |
It's fine because it's easier to maintain anyway, unlike when you were using the |
Thank you for the suggestion. However, I would prefer using a symbol, |
Thank you for implementing the wildcard functionality. It's certainly a valuable feature to have. However, I believe it would also be beneficial to provide an option for exact matching without wildcards. This ensures precision when needed and caters to different use cases. What do you think about adding support for both wildcard and exact matching? Let me know your thoughts! |
I meant |
@fred-bf any chance to merge this pr? thx |
非常需要,期待合入 |
Very much needed, looking forward to incorporating |
@H0llyW00dzZ Hi Hollywoodzz, could you please help me ask the owner if this PR can be merged? Some API vendors do not support "claude-3-*" as the vision model. |
@wayoungofustc |
@Dean-YZG |
😞 |
😞 |
Title: Add environment variable $CUSTOM_VISION_MODELS for additional vision model discrimination
Description:
For user-defined models, there are some scenarios that do not conform to the design of the commit fix vision detect method.
For example: CUSTOM_MODELS=+claude-3-opus-20240229,+claude-3-sonnet-20240229
Considering this scenario, renaming the model by adding "vision" to its name is a feasible method.
However, this method imposes a cognitive burden on users, as memorizing and understanding the lengthened or changed model names are required.
Therefore, this commit introduces a method that adds an environment variable $CUSTOM_VISION_MODELS to provide additional discrimination for vision models.
It has been tested locally.
Test method:
export CUSTOM_MODELS=+claude-3-opus-20240229,+claude-3-sonnet-20240229,+gpt-4-1106-preview,+gpt-4-0125-preview,+gpt-4-32k
export CUSTOM_VISION_MODELS=+claude-3-opus-20240229,+claude-3-sonnet-20240229
yarn dev
Check the browser at http://localhost:3000/
When switching the model to claude-3-opus-20240229, the image upload button is displayed.
When switching to gpt-4-32k, the image upload button is not displayed.