From 0317c06783c809b1a5edc52457224e24b6496ff8 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 21 Jan 2026 14:03:53 +0400 Subject: [PATCH] fix: respect configured context_size in embed_batch --- src/core/embeddings.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/embeddings.rs b/src/core/embeddings.rs index be77c5b..3921d36 100644 --- a/src/core/embeddings.rs +++ b/src/core/embeddings.rs @@ -1,4 +1,5 @@ use anyhow::{Context, Result}; +use std::num::NonZeroU32; use std::path::Path; use std::sync::Once; @@ -78,6 +79,7 @@ impl EmbeddingEngine { .unwrap_or(4); let ctx_params = LlamaContextParams::default() + .with_n_ctx(Some(NonZeroU32::new(self.n_ctx as u32).unwrap())) .with_n_threads_batch(n_threads) .with_n_threads(n_threads) .with_embeddings(true);