From 065f91d8dd129610b6617aa4f0600f16ea1f76b7 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Fri, 12 Jul 2024 22:53:39 +0800 Subject: [PATCH] hotfix: bytedance custom models --- app/utils/model.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/utils/model.ts b/app/utils/model.ts index 551cc766e..663b3c109 100644 --- a/app/utils/model.ts +++ b/app/utils/model.ts @@ -72,10 +72,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,