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 // 2. if model not exists, create new model with available value
if (count === 0) { if (count === 0) {
const [customModelName, customProviderName] = name.split("@"); let [customModelName, customProviderName] = name.split("@");
const provider = customProvider( const provider = customProvider(
customProviderName || customModelName, customProviderName || customModelName,
); );
// swap name and displayName for bytedance
if (displayName && provider.providerName == "ByteDance") {
[customModelName, displayName] = [displayName, customModelName];
}
modelTable[`${customModelName}@${provider?.id}`] = { modelTable[`${customModelName}@${provider?.id}`] = {
name: customModelName, name: customModelName,
displayName: displayName || customModelName, displayName: displayName || customModelName,