liyaoshi commited on
Commit
ddfef73
1 Parent(s): 8e5c043

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -96,6 +96,9 @@ def get_completion(message,history,system_message,max_tokens,temperature):
96
 
97
  history_openai_format = []
98
  for human, assistant in history:
 
 
 
99
  history_openai_format.append({"role": "user", "content": human })
100
  history_openai_format.append({"role": "assistant", "content":assistant})
101
  history_openai_format.append({"role": "user", "content": content})
 
96
 
97
  history_openai_format = []
98
  for human, assistant in history:
99
+ # 歷史消息中跳过包含图片的对话
100
+ if isinstance(human, tuple):
101
+ continue
102
  history_openai_format.append({"role": "user", "content": human })
103
  history_openai_format.append({"role": "assistant", "content":assistant})
104
  history_openai_format.append({"role": "user", "content": content})