Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
6vision committed Sep 13, 2024
1 parent 5ef929d commit c4f9acd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bot/chatgpt/chat_gpt_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def __init__(self):
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]之间,越大表示回复越具有不确定性
Expand All @@ -46,7 +45,8 @@ def __init__(self):
"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 来避免抛出错误
Expand Down

0 comments on commit c4f9acd

Please sign in to comment.