Tuchuanhuhuhu commited on
Commit
08e7229
·
1 Parent(s): 11764da

修复点击总结对话导致listindexoutofrange的问题

Browse files
Files changed (1) hide show
  1. ChuanhuChatbot.py +2 -2
ChuanhuChatbot.py CHANGED
@@ -87,7 +87,7 @@ def predict(inputs, top_p, temperature, openai_api_key, chatbot=[], history=[],
87
  messages[-1]['content'] = temp2['content']
88
  if retry and chat_counter:
89
  messages.pop()
90
- elif summary and chat_counter:
91
  messages.append(compose_user(
92
  "请帮我总结一下上述对话的内容,实现减少字数的同时,保证对话的质量。在总结中不要加入这一句话。"))
93
  history = ["我们刚刚聊了什么?"]
@@ -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
- 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)
 
87
  messages[-1]['content'] = temp2['content']
88
  if retry and chat_counter:
89
  messages.pop()
90
+ elif summary:
91
  messages.append(compose_user(
92
  "请帮我总结一下上述对话的内容,实现减少字数的同时,保证对话的质量。在总结中不要加入这一句话。"))
93
  history = ["我们刚刚聊了什么?"]
 
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)