hotfix: bytedance custom models

This commit is contained in:
lloydzhou 2024-07-12 22:53:39 +08:00
parent 476bdac717
commit 46d3e7884b
1 changed files with 5 additions and 1 deletions

View File

@ -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,