From 6fc870808115575312bce59029c9a2b3fdf52354 Mon Sep 17 00:00:00 2001 From: yi wang <48236141+my-vegetable-has-exploded@users.noreply.github.com> Date: Sat, 30 Mar 2024 21:09:50 +0800 Subject: [PATCH] fix: validate_index for veci8 & rm deprecated feature. (#451) Signed-off-by: my-vegetable-has-exploded --- Cargo.toml | 1 - crates/base/src/index.rs | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ab50e25f3..30924014c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,6 @@ half = { version = "2.4.0", features = [ "num-traits", "rand_distr", "serde", - "use-intrinsics", ] } libc = "0.2.153" log = "0.4.21" diff --git a/crates/base/src/index.rs b/crates/base/src/index.rs index b7001c341..ae3222a7c 100644 --- a/crates/base/src/index.rs +++ b/crates/base/src/index.rs @@ -127,7 +127,10 @@ pub struct IndexOptions { impl IndexOptions { fn validate_index_options(options: &IndexOptions) -> Result<(), ValidationError> { - if options.vector.v != VectorKind::SVecf32 && options.vector.v != VectorKind::BVecf32 { + if options.vector.v != VectorKind::SVecf32 + && options.vector.v != VectorKind::BVecf32 + && options.vector.v != VectorKind::Veci8 + { return Ok(()); } let is_trivial = match &options.indexing { @@ -137,7 +140,7 @@ impl IndexOptions { }; if !is_trivial { return Err(ValidationError::new( - "Quantization is not supported for svector and bvector.", + "Quantization is not supported for svector, bvector, and vecint8.", )); } Ok(())