Update bot/openai/open_ai_bot.py
Browse files
bot/openai/open_ai_bot.py
CHANGED
@@ -43,11 +43,11 @@ class OpenAIBot(Bot):
|
|
43 |
response = openai.Completion.create(
|
44 |
model="text-davinci-003", # 对话模型的名称
|
45 |
prompt=query,
|
46 |
-
temperature=
|
47 |
-
max_tokens=
|
48 |
top_p=1,
|
49 |
-
frequency_penalty=0.
|
50 |
-
presence_penalty=0.
|
51 |
stop=["\n\n\n"]
|
52 |
)
|
53 |
res_content = response.choices[0]['text'].strip().replace('<|endoftext|>', '')
|
|
|
43 |
response = openai.Completion.create(
|
44 |
model="text-davinci-003", # 对话模型的名称
|
45 |
prompt=query,
|
46 |
+
temperature=0.5, # 值在[0,1]之间,越大表示回复越具有不确定性
|
47 |
+
max_tokens=1500, # 回复最大的字符数
|
48 |
top_p=1,
|
49 |
+
frequency_penalty=0.5, # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
50 |
+
presence_penalty=0.5, # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
51 |
stop=["\n\n\n"]
|
52 |
)
|
53 |
res_content = response.choices[0]['text'].strip().replace('<|endoftext|>', '')
|