From c2f56c51636b046dbe8306b44ba01ad32911e80c Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Jan 2026 22:35:51 +0400 Subject: [PATCH] fix: log warning when input text is truncated to context limit --- src/core/embeddings.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/embeddings.rs b/src/core/embeddings.rs index be77c5b..dbdd036 100644 --- a/src/core/embeddings.rs +++ b/src/core/embeddings.rs @@ -96,6 +96,11 @@ impl EmbeddingEngine { .context("Failed to tokenize")?; let tokens: Vec<_> = if tokens.len() > self.n_ctx { + eprintln!( + "Warning: Input text truncated from {} to {} tokens (context limit)", + tokens.len(), + self.n_ctx + ); tokens.into_iter().take(self.n_ctx).collect() } else { tokens