set the memory in arroy

This commit is contained in:
Tamo
2025-03-13 11:05:25 +01:00
committed by Kerollmops
parent d3d22d8ed4
commit ef9d9f8481
5 changed files with 34 additions and 5 deletions

View File

@ -101,6 +101,7 @@ pub fn build_vectors<MSP>(
index: &Index,
wtxn: &mut RwTxn<'_>,
index_embeddings: Vec<IndexEmbeddingConfig>,
arroy_memory: Option<usize>,
arroy_writers: &mut HashMap<u8, (&str, &Embedder, ArroyWrapper, usize)>,
must_stop_processing: &MSP,
) -> Result<()>
@ -114,7 +115,14 @@ where
let mut rng = rand::rngs::StdRng::seed_from_u64(42);
for (_index, (_embedder_name, _embedder, writer, dimensions)) in arroy_writers {
let dimensions = *dimensions;
writer.build_and_quantize(wtxn, &mut rng, dimensions, false, must_stop_processing)?;
writer.build_and_quantize(
wtxn,
&mut rng,
dimensions,
false,
arroy_memory,
must_stop_processing,
)?;
}
index.put_embedding_configs(wtxn, index_embeddings)?;