fix: encoding bug

This commit is contained in:
zhayujie
2022-12-18 14:03:34 +08:00
parent 4ce6de07f5
commit 06065853a9
5 changed files with 15 additions and 5 deletions

View File

@@ -1,3 +1,5 @@
# encoding:utf-8
from bot.bot import Bot
from config import conf
from common.log import logger
@@ -19,7 +21,7 @@ class OpenAIBot(Bot):
max_tokens=1200, #回复最大的字符数
top_p=1,
frequency_penalty=0.0, #[-2,2]之间,该值越大则更倾向于产生不同的内容
presence_penalty=0.2, #[-2,2]之间,该值越大则更倾向于产生不同的内容
presence_penalty=0.6, #[-2,2]之间,该值越大则更倾向于产生不同的内容
stop=["#"]
)
res_content = response.choices[0]["text"].strip()
@@ -28,3 +30,5 @@ class OpenAIBot(Bot):
return None
logger.info("[OPEN_AI] reply={}".format(res_content))
return res_content