diff --git a/web-apps/chat/app.py b/web-apps/chat/app.py index b2ebaa0..18284bb 100644 --- a/web-apps/chat/app.py +++ b/web-apps/chat/app.py @@ -70,7 +70,7 @@ def inference(latest_message, history): context = [] if INCLUDE_SYSTEM_PROMPT: context.append(SystemMessage(content=settings.model_instruction)) - else: + elif history and len(history) > 0: # Mimic system prompt by prepending it to first human message history[0]['content'] = f"{settings.model_instruction}\n\n{history[0]['content']}"