From 6aebabbd7cf832a747f04ed3af21cdffb7d85a33 Mon Sep 17 00:00:00 2001 From: ManJieqi <363071559@139.com> Date: Mon, 1 Apr 2024 18:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=99=BE=E5=BA=A6=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/model-ratio.go | 15 +++++++++------ relay/channel/baidu/adaptor.go | 18 ++++++++---------- relay/channel/baidu/constants.go | 14 ++++++++------ 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/common/model-ratio.go b/common/model-ratio.go index aa75042e..eb8b9e3d 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -72,14 +72,17 @@ var ModelRatio = map[string]float64{ "claude-3-sonnet-20240229": 3.0 / 1000 * USD, "claude-3-opus-20240229": 15.0 / 1000 * USD, // https://cloud.baidu.com/doc/WENXINWORKSHOP/s/hlrk4akp7 - "ERNIE-Bot": 0.8572, // ¥0.012 / 1k tokens - "ERNIE-Bot-turbo": 0.5715, // ¥0.008 / 1k tokens - "ERNIE-Bot-4": 0.12 * RMB, // ¥0.12 / 1k tokens - "ERNIE-Bot-8K": 0.024 * RMB, - "Embedding-V1": 0.1429, // ¥0.002 / 1k tokens + "ERNIE-4.0-8K": 0.150 * RMB, + "ERNIE-3.5-8K": 0.012 * RMB, + "ERNIE-Speed-8K": 0.004 * RMB, + "ERNIE-Speed-128K":0.004 * RMB, + "ERNIE-Lite-8K": 0.003 * RMB, + "ERNIE-Tiny-8K": 0.001 * RMB, + "BLOOMZ-7B": 0.004 * RMB, + "Embedding-V1": 0.002 * RMB, "bge-large-zh": 0.002 * RMB, "bge-large-en": 0.002 * RMB, - "bge-large-8k": 0.002 * RMB, + "tao-8k": 0.002 * RMB, // https://ai.google.dev/pricing "PaLM-2": 1, "gemini-pro": 1, // $0.00025 / 1k characters -> $0.001 / 1k tokens diff --git a/relay/channel/baidu/adaptor.go b/relay/channel/baidu/adaptor.go index 2d2e24f6..7e898aa2 100644 --- a/relay/channel/baidu/adaptor.go +++ b/relay/channel/baidu/adaptor.go @@ -34,20 +34,18 @@ func (a *Adaptor) GetRequestURL(meta *util.RelayMeta) (string, error) { suffix = "embeddings/" } switch meta.ActualModelName { - case "ERNIE-4.0": - suffix += "completions_pro" - case "ERNIE-Bot-4": + case "ERNIE-4.0-8K": suffix += "completions_pro" case "ERNIE-3.5-8K": suffix += "completions" - case "ERNIE-Bot-8K": - suffix += "ernie_bot_8k" - case "ERNIE-Bot": - suffix += "completions" - case "ERNIE-Speed": + case "ERNIE-Speed-8K": suffix += "ernie_speed" - case "ERNIE-Bot-turbo": - suffix += "eb-instant" + case "ERNIE-Speed-128K": + suffix += "ernie-speed-128k" + case "ERNIE-Lite-8K": + suffix += "ernie-lite-8k" + case "ERNIE-Tiny-8K": + suffix += "ernie-tiny-8k" case "BLOOMZ-7B": suffix += "bloomz_7b1" case "Embedding-V1": diff --git a/relay/channel/baidu/constants.go b/relay/channel/baidu/constants.go index 45a4e901..d5a36612 100644 --- a/relay/channel/baidu/constants.go +++ b/relay/channel/baidu/constants.go @@ -1,13 +1,15 @@ package baidu var ModelList = []string{ - "ERNIE-Bot-4", - "ERNIE-Bot-8K", - "ERNIE-Bot", - "ERNIE-Speed", - "ERNIE-Bot-turbo", + "ERNIE-4.0-8K", + "ERNIE-3.5-8K", + "ERNIE-Speed-8K", + "ERNIE-Speed-128K", + "ERNIE-Lite-8K", + "ERNIE-Tiny-8K", + "BLOOMZ-7B", "Embedding-V1", "bge-large-zh", "bge-large-en", "tao-8k", -} +} \ No newline at end of file