Skip to content

Commit

Permalink
Merge pull request #6134 from zcong1993/main
Browse files Browse the repository at this point in the history
fix: fix isModelNotavailableInServer logic for bytedance models
  • Loading branch information
Leizhenpeng authored Feb 4, 2025
2 parents b6881c7 + 92f57fb commit 5db6775
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/utils/model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DEFAULT_MODELS } from "../constant";
import { DEFAULT_MODELS, ServiceProvider } from "../constant";
import { LLMModel } from "../client/api";

const CustomSeq = {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 5db6775

Please sign in to comment.