Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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})
|