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