From c4f9acd5c587847fb355f88fcf7eb2212bbb0075 Mon Sep 17 00:00:00 2001 From: 6vision Date: Fri, 13 Sep 2024 10:48:51 +0800 Subject: [PATCH] update --- bot/chatgpt/chat_gpt_bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/chatgpt/chat_gpt_bot.py b/bot/chatgpt/chat_gpt_bot.py index 8ff3345..154a422 100644 --- a/bot/chatgpt/chat_gpt_bot.py +++ b/bot/chatgpt/chat_gpt_bot.py @@ -33,8 +33,7 @@ class ChatGPTBot(Bot, OpenAIImage): conf_model = conf().get("model") or "gpt-3.5-turbo" self.sessions = SessionManager(ChatGPTSession, model=conf().get("model") or "gpt-3.5-turbo") # o1相关模型不支持system prompt,暂时用文心模型的session - if conf_model == const.O1 or const.O1_MINI: - self.sessions = SessionManager(BaiduWenxinSession, model=conf().get("model") or const.O1_MINI) + self.args = { "model": conf_model, # 对话模型的名称 "temperature": conf().get("temperature", 0.9), # 值在[0,1]之间,越大表示回复越具有不确定性 @@ -46,7 +45,8 @@ class ChatGPTBot(Bot, OpenAIImage): "timeout": conf().get("request_timeout", None), # 重试超时时间,在这个时间内,将会自动重试 } # o1相关模型固定了部分参数,暂时去掉 - if conf_model == const.O1 or const.O1_MINI: + if conf_model in [const.O1, const.O1_MINI]: + self.sessions = SessionManager(BaiduWenxinSession, model=conf().get("model") or const.O1_MINI) remove_keys = ["temperature", "top_p", "frequency_penalty", "presence_penalty"] for key in remove_keys: self.args.pop(key, None) # 如果键不存在,使用 None 来避免抛出错误