From c9a46140e6fd00ab09eb0726169a3747e86441ce Mon Sep 17 00:00:00 2001 From: ParthSareen Date: Thu, 19 Dec 2024 13:48:25 -0800 Subject: [PATCH] Warn user on truncation - ollama logs --- server/prompt.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/prompt.go b/server/prompt.go index 4af457c17..31fc418e9 100644 --- a/server/prompt.go +++ b/server/prompt.go @@ -82,6 +82,10 @@ func chatPrompt(ctx context.Context, m *Model, tokenize tokenizeFunc, opts *api. } currMsgIdx := n + // Warn user if messages are truncated from the input + if numTruncatedMessages := len(msgs[0:currMsgIdx]); numTruncatedMessages > 0 { + slog.Warn("truncated first messages from input", "num_truncated", numTruncatedMessages) + } for cnt, msg := range msgs[currMsgIdx:] { prefix := ""