From 43e5dc22920c60bf87fc1b78bf95c441356bb1d8 Mon Sep 17 00:00:00 2001 From: Fred Date: Wed, 28 Feb 2024 11:33:43 +0800 Subject: [PATCH] fix: fix the method to detect vision model --- app/client/platforms/openai.ts | 2 +- app/utils.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 437aff582ac..629158843c4 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -116,7 +116,7 @@ export class ChatGPTApi implements LLMApi { enumerable: true, configurable: true, writable: true, - value: Math.max(modelConfig.max_tokens, 4096), + value: modelConfig.max_tokens, }); } diff --git a/app/utils.ts b/app/utils.ts index 33b8eccd2a0..0436a128a64 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -292,8 +292,8 @@ export function getMessageImages(message: RequestMessage): string[] { export function isVisionModel(model: string) { return ( - model.startsWith("gpt-4-vision") || - model.startsWith("gemini-pro-vision") || - !DEFAULT_MODELS.find((m) => m.name == model) + // model.startsWith("gpt-4-vision") || + // model.startsWith("gemini-pro-vision") || + model.includes("vision") ); }