mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-05 20:26:31 +00:00
wip: Use Hamming when binary quantized
This commit is contained in:
committed by
Clément Renault
parent
ad77aaff20
commit
811be520c0
@ -4,7 +4,7 @@ use std::sync::{Arc, Mutex};
|
||||
use std::time::Instant;
|
||||
|
||||
use deserr::{DeserializeError, Deserr};
|
||||
use hannoy::distances::{BinaryQuantizedCosine, Cosine};
|
||||
use hannoy::distances::{Cosine, Hamming};
|
||||
use hannoy::ItemId;
|
||||
use heed::{RoTxn, RwTxn, Unspecified};
|
||||
use ordered_float::OrderedFloat;
|
||||
@ -168,7 +168,7 @@ 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)?;
|
||||
let writer = writer.prepare_changing_distance::<Hamming>(wtxn)?;
|
||||
writer
|
||||
.builder(rng)
|
||||
.available_memory(hannoy_memory.unwrap_or(usize::MAX))
|
||||
@ -553,7 +553,7 @@ impl VectorStore {
|
||||
self.database.remap_data_type()
|
||||
}
|
||||
|
||||
fn quantized_db(&self) -> hannoy::Database<BinaryQuantizedCosine> {
|
||||
fn quantized_db(&self) -> hannoy::Database<Hamming> {
|
||||
self.database.remap_data_type()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user