Spaces:
Runtime error
Runtime error
mkw18
commited on
Commit
·
7d12d67
1
Parent(s):
292531e
term
Browse files
app.py
CHANGED
@@ -80,18 +80,19 @@ def predict(input, chatbot, messages, idx, answer):
|
|
80 |
)
|
81 |
response=completion.choices[0].message.content.strip()
|
82 |
messages.append({"role": "assistant", "content": response})
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
95 |
data = {'predict': messages, 'idx': idx, 'isfinished': finish, 'answer': answer}
|
96 |
requests.post(os.environ.get("URL"), data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
|
97 |
chatbot[-1] = (parse_text(input), parse_text(response))
|
|
|
80 |
)
|
81 |
response=completion.choices[0].message.content.strip()
|
82 |
messages.append({"role": "assistant", "content": response})
|
83 |
+
finish = False
|
84 |
+
# messages1 = messages + [{"role": 'user', "content": '我猜到汤底了吗?请回答是或否,注意仅出现“汤底”二字或者我并没有问到汤底相关细节时不能说明我猜到了汤底。'}]
|
85 |
+
# completion1 = openai.ChatCompletion.create(
|
86 |
+
# model="gpt-3.5-turbo",
|
87 |
+
# messages=messages1,
|
88 |
+
# )
|
89 |
+
# response1=completion1.choices[0].message.content.strip()
|
90 |
+
# if '不' in response1 or '否' in response1 or '没' in response1:
|
91 |
+
# response = response
|
92 |
+
# finish = False
|
93 |
+
# else:
|
94 |
+
# response += f'恭喜您已经猜到汤底,汤底是:{answer}\n点击“再来一局”按钮开始下一局游戏。'
|
95 |
+
# finish = True
|
96 |
data = {'predict': messages, 'idx': idx, 'isfinished': finish, 'answer': answer}
|
97 |
requests.post(os.environ.get("URL"), data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
|
98 |
chatbot[-1] = (parse_text(input), parse_text(response))
|