Skip to content

Commit f9c7203

Browse files
committed
Fix error with long messages breaking for everyone
1 parent ae7e206 commit f9c7203

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web-apps/chat/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def inference(latest_message, history):
7070
context = []
7171
if INCLUDE_SYSTEM_PROMPT:
7272
context.append(SystemMessage(content=settings.model_instruction))
73-
else:
73+
elif history and len(history) > 0:
7474
# Mimic system prompt by prepending it to first human message
7575
history[0]['content'] = f"{settings.model_instruction}\n\n{history[0]['content']}"
7676

0 commit comments

Comments
 (0)