From 1a73669df82f4b8610ccd894e0c371adee0537d6 Mon Sep 17 00:00:00 2001 From: Shi Zhenning <105858279+flashszn@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:38:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=AC=A6=E5=90=88oneapi?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8E=A5=E5=8F=A3=E7=9A=84=E5=9B=BD=E5=86=85?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit oneapi是一个api整合项目,通过这个项目的反代理,可以像使用gpt系列的/v1/completion接口一样调用国内的大模型,仅仅需要更改一下模型名字 --- pkg/openai/modelmgr.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkg/openai/modelmgr.py b/pkg/openai/modelmgr.py index cdc51297..a341acdd 100644 --- a/pkg/openai/modelmgr.py +++ b/pkg/openai/modelmgr.py @@ -32,7 +32,15 @@ CHAT_COMPLETION_MODELS = { 'gpt-4', 'gpt-4-0613', 'gpt-4-32k', - 'gpt-4-32k-0613' + 'gpt-4-32k-0613', + 'SparkDesk', + 'chatglm_pro', + 'chatglm_std', + 'chatglm_lite', + 'qwen-v1', + 'qwen-plus-v1', + 'ERNIE-Bot', + 'ERNIE-Bot-turbo', } EDIT_MODELS = { @@ -66,6 +74,14 @@ def count_chat_completion_tokens(messages: list, model: str) -> int: "gpt-4-32k-0314", "gpt-4-0613", "gpt-4-32k-0613", + "SparkDesk", + "chatglm_pro", + "chatglm_std", + "chatglm_lite", + "qwen-v1", + "qwen-plus-v1", + "ERNIE-Bot", + "ERNIE-Bot-turbo", }: tokens_per_message = 3 tokens_per_name = 1