From 710a6de7bccdd40cf1b1c2d86c28ebc406f21272 Mon Sep 17 00:00:00 2001 From: Charlotte Som Date: Wed, 26 Feb 2025 10:41:39 +0000 Subject: [PATCH] load the system prompt on-the-fly instead of once at startup this lets us modify it [for new conversations] on disk while the llm server is running --- server/inference.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/inference.py b/server/inference.py index 625b07f..1d3a92b 100644 --- a/server/inference.py +++ b/server/inference.py @@ -4,7 +4,6 @@ from .tid import tid_now from json import dumps as json db = sqlite_utils.Database(llm.cli.logs_db_path()) -girlypop_prompt = llm.cli.load_template("girlypop").system async def list_conversations(request: Request): @@ -38,7 +37,7 @@ async def connect_to_conversation(ws: WebSocket): await ws.accept() # only send the system prompt at the start of a conversation - system_prompt = girlypop_prompt + system_prompt = llm.cli.load_template("girlypop").system if not continuing: for response in conversation.responses: