mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-03-19 21:38:18 +08:00
fix: encoding bug
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user