From c135d1c02215802257bf3ee3a2c1dd191b353b59 Mon Sep 17 00:00:00 2001 From: Sakurasan <1173092237@qq.com> Date: Sat, 1 Jul 2023 17:05:45 +0800 Subject: [PATCH] update azure model --- doc/azure.md | 1 + doc/pandora.md | 2 +- router/router.go | 8 +++----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/azure.md b/doc/azure.md index 25d2520..0b05d52 100644 --- a/doc/azure.md +++ b/doc/azure.md @@ -8,6 +8,7 @@ | model name | deployment name | | --- | --- | |gpt-35-turbo | gpt-35-turbo | +|gpt-35-turbo-16k | gpt-35-turbo-16k | | gpt-4 | gpt-4 | ## How to use diff --git a/doc/pandora.md b/doc/pandora.md index 582502d..d4ff909 100644 --- a/doc/pandora.md +++ b/doc/pandora.md @@ -1,6 +1,6 @@ # pandora for team -[pandora](pandora)是一个把ChatGPT(web/App)接口化的项目,可以看做是第三方 OpenAI API 提供方(接口和OpenAI一致) +[pandora](https://github.com/pengzhile/pandora)是一个把ChatGPT(web/App)接口化的项目,可以看做是第三方 OpenAI API 提供方(接口和OpenAI一致) ## 准备 - https://ai.fakeopen.com/auth1 获取accesstoken diff --git a/router/router.go b/router/router.go index a6c5370..9368602 100644 --- a/router/router.go +++ b/router/router.go @@ -772,11 +772,9 @@ func NumTokensFromStr(messages string, model string) (num_tokens int) { } func modelmap(in string) string { - switch in { - case "gpt-3.5-turbo": - return "gpt-35-turbo" - case "gpt-4": - return "gpt-4" + // gpt-3.5-turbo -> gpt-35-turbo + if strings.HasSuffix(in, ".") { + return strings.ReplaceAll(in, ".", "") } return in }