From a610b6bd8d9cbbfe29f3866389e8f4a60858b022 Mon Sep 17 00:00:00 2001 From: Weves Date: Mon, 13 Jan 2025 13:11:07 -0800 Subject: [PATCH] Support new model for image input --- web/src/lib/llm/utils.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/lib/llm/utils.ts b/web/src/lib/llm/utils.ts index 6fc1fc7a9..3eca6cacc 100644 --- a/web/src/lib/llm/utils.ts +++ b/web/src/lib/llm/utils.ts @@ -102,12 +102,13 @@ const MODEL_NAMES_SUPPORTING_IMAGE_INPUT = [ // meta models "llama-3.2-90b-vision-instruct", "llama-3.2-11b-vision-instruct", + "Llama-3-2-11B-Vision-Instruct-yb", ]; export function checkLLMSupportsImageInput(model: string) { // Original exact match check const exactMatch = MODEL_NAMES_SUPPORTING_IMAGE_INPUT.some( - (modelName) => modelName === model + (modelName) => modelName.toLowerCase() === model.toLowerCase() ); if (exactMatch) { @@ -116,12 +117,13 @@ export function checkLLMSupportsImageInput(model: string) { // Additional check for the last part of the model name const modelParts = model.split(/[/.]/); - const lastPart = modelParts[modelParts.length - 1]; + const lastPart = modelParts[modelParts.length - 1]?.toLowerCase(); return MODEL_NAMES_SUPPORTING_IMAGE_INPUT.some((modelName) => { const modelNameParts = modelName.split(/[/.]/); const modelNameLastPart = modelNameParts[modelNameParts.length - 1]; - return modelNameLastPart === lastPart; + // lastPart is already lowercased above for tiny performance gain + return modelNameLastPart?.toLowerCase() === lastPart; }); }