Przeglądaj źródła

Warn user on truncation - ollama logs

ParthSareen 4 miesięcy temu
rodzic
commit
c9a46140e6
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      server/prompt.go

+ 4 - 0
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 := ""