From c70c614018a5992890564cba28d3d6172c8f71b3 Mon Sep 17 00:00:00 2001 From: papersnake Date: Sun, 5 Nov 2023 17:59:38 +0800 Subject: [PATCH] feat: support chatglm_turbo (#648) * feat: support chatglm_turbo * fix: remove characterglm --- common/model-ratio.go | 1 + controller/model.go | 9 +++++++++ web/src/pages/Channel/EditChannel.js | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/model-ratio.go b/common/model-ratio.go index f52e1101229bc..8f4be8c3ca182 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -49,6 +49,7 @@ var ModelRatio = map[string]float64{ "ERNIE-Bot-4": 8.572, // ¥0.12 / 1k tokens "Embedding-V1": 0.1429, // ¥0.002 / 1k tokens "PaLM-2": 1, + "chatglm_turbo": 0.3572, // ¥0.005 / 1k tokens "chatglm_pro": 0.7143, // ¥0.01 / 1k tokens "chatglm_std": 0.3572, // ¥0.005 / 1k tokens "chatglm_lite": 0.1429, // ¥0.002 / 1k tokens diff --git a/controller/model.go b/controller/model.go index ed35b7a694b60..2a7dc538c1b9e 100644 --- a/controller/model.go +++ b/controller/model.go @@ -333,6 +333,15 @@ func init() { Root: "PaLM-2", Parent: nil, }, + { + Id: "chatglm_turbo", + Object: "model", + Created: 1677649963, + OwnedBy: "zhipu", + Permission: permission, + Root: "chatglm_turbo", + Parent: nil, + }, { Id: "chatglm_pro", Object: "model", diff --git a/web/src/pages/Channel/EditChannel.js b/web/src/pages/Channel/EditChannel.js index 3b059d7b5fb06..654a5d51c2378 100644 --- a/web/src/pages/Channel/EditChannel.js +++ b/web/src/pages/Channel/EditChannel.js @@ -72,7 +72,7 @@ const EditChannel = () => { localModels = ['qwen-turbo', 'qwen-plus', 'text-embedding-v1']; break; case 16: - localModels = ['chatglm_pro', 'chatglm_std', 'chatglm_lite']; + localModels = ['chatglm_turbo', 'chatglm_pro', 'chatglm_std', 'chatglm_lite']; break; case 18: localModels = ['SparkDesk'];