Reintroduce changing the distance from Cosine to Cosine binary quantized

This commit is contained in:
Kerollmops
2025-08-06 15:08:48 +02:00
committed by Louis Dureuil
parent f5f173e451
commit 900e8a0d9c

View File

@ -166,20 +166,20 @@ impl VectorStore {
// only happens once in the life of an embedder, it's not very performances
// sensitive.
if quantizing && !self.quantized {
// let writer = writer.prepare_changing_distance::<BinaryQuantizedCosine>(wtxn)?;
// writer
// .builder(rng)
// .available_memory(hannoy_memory.unwrap_or(usize::MAX))
// .progress(|step| progress.update_progress_from_hannoy(step))
// .cancel(cancel)
// .build(wtxn)?;
unimplemented!("switching from quantized to non-quantized");
let writer = writer.prepare_changing_distance::<BinaryQuantizedCosine>(wtxn)?;
writer
.builder(rng)
.available_memory(hannoy_memory.unwrap_or(usize::MAX))
// .progress(|step| progress.update_progress_from_hannoy(step))
.cancel(cancel)
.ef_construction(HANNOY_EF_CONSTRUCTION)
.build::<HANNOY_M, HANNOY_M0>(wtxn)?;
} else if writer.need_build(wtxn)? {
writer
.builder(rng)
.available_memory(hannoy_memory.unwrap_or(usize::MAX))
// .progress(|step| progress.update_progress_from_hannoy(step))
// .cancel(cancel)
.cancel(cancel)
.ef_construction(HANNOY_EF_CONSTRUCTION)
.build::<HANNOY_M, HANNOY_M0>(wtxn)?;
} else if writer.is_empty(wtxn)? {