From 92f57fb18fe40e73a425842747d4b5654493f275 Mon Sep 17 00:00:00 2001 From: zcong1993 Date: Mon, 3 Feb 2025 16:58:42 +0800 Subject: [PATCH] fix: fix isModelNotavailableInServer logic for bytedance models --- app/utils/model.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/utils/model.ts b/app/utils/model.ts index a1a38a2f81c..f460babcd25 100644 --- a/app/utils/model.ts +++ b/app/utils/model.ts @@ -1,4 +1,4 @@ -import { DEFAULT_MODELS } from "../constant"; +import { DEFAULT_MODELS, ServiceProvider } from "../constant"; import { LLMModel } from "../client/api"; const CustomSeq = { @@ -246,6 +246,11 @@ export function isModelNotavailableInServer( ? providerNames : [providerNames]; for (const providerName of providerNamesArray) { + // if model provider is bytedance, use model config name to check if not avaliable + if (providerName === ServiceProvider.ByteDance) { + return !Object.values(modelTable).filter((v) => v.name === modelName)?.[0] + ?.available; + } const fullName = `${modelName}@${providerName.toLowerCase()}`; if (modelTable?.[fullName]?.available === true) return false; }