Skip to content

Commit 4610a4d

Browse files
committed
feat: Use num_ctx instead of truncate for embedding truncation
1 parent 0e1d08a commit 4610a4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/models/embedding/ollama.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ func (e *OllamaEmbedder) BatchEmbed(ctx context.Context, texts []string) ([][]fl
9595

9696
// Set truncation parameters
9797
if e.truncatePromptTokens > 0 {
98-
req.Options["truncate"] = e.truncatePromptTokens
98+
req.Options["num_ctx"] = e.truncatePromptTokens
99+
truncate := true
100+
req.Truncate = &truncate
99101
}
100102

101103
// Send request

0 commit comments

Comments
 (0)