Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
·
fd3d76e
1
Parent(s):
8839811
修复删除上一条对话出错的问题
Browse files- ChuanhuChatbot.py +4 -6
ChuanhuChatbot.py
CHANGED
|
@@ -111,7 +111,7 @@ def predict(inputs, top_p, temperature, openai_api_key, chatbot=[], history=[],
|
|
| 111 |
|
| 112 |
if not summary:
|
| 113 |
history.append(inputs)
|
| 114 |
-
|
| 115 |
# make a POST request to the API endpoint using the requests.post method, passing in stream=True
|
| 116 |
response = requests.post(API_URL, headers=headers,
|
| 117 |
json=payload, stream=True)
|
|
@@ -156,11 +156,9 @@ def predict(inputs, top_p, temperature, openai_api_key, chatbot=[], history=[],
|
|
| 156 |
|
| 157 |
|
| 158 |
def delete_last_conversation(chatbot, history):
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
history.pop()
|
| 163 |
-
history.pop()
|
| 164 |
return chatbot, history
|
| 165 |
|
| 166 |
def save_chat_history(filename, system, history, chatbot):
|
|
|
|
| 111 |
|
| 112 |
if not summary:
|
| 113 |
history.append(inputs)
|
| 114 |
+
print(f"payload is - {payload}")
|
| 115 |
# make a POST request to the API endpoint using the requests.post method, passing in stream=True
|
| 116 |
response = requests.post(API_URL, headers=headers,
|
| 117 |
json=payload, stream=True)
|
|
|
|
| 156 |
|
| 157 |
|
| 158 |
def delete_last_conversation(chatbot, history):
|
| 159 |
+
chatbot.pop()
|
| 160 |
+
history.pop()
|
| 161 |
+
history.pop()
|
|
|
|
|
|
|
| 162 |
return chatbot, history
|
| 163 |
|
| 164 |
def save_chat_history(filename, system, history, chatbot):
|