Skip to content

Commit

Permalink
hotfix: bytedance custom models
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Jul 12, 2024
1 parent 476bdac commit 46d3e78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/utils/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ export function collectModelTable(
}
// 2. if model not exists, create new model with available value
if (count === 0) {
const [customModelName, customProviderName] = name.split("@");
let [customModelName, customProviderName] = name.split("@");
const provider = customProvider(
customProviderName || customModelName,
);
// swap name and displayName for bytedance
if (displayName && provider.providerName == "ByteDance") {
[customModelName, displayName] = [displayName, customModelName];
}
modelTable[`${customModelName}@${provider?.id}`] = {
name: customModelName,
displayName: displayName || customModelName,
Expand Down

0 comments on commit 46d3e78

Please sign in to comment.