Skip to content

Commit

Permalink
fix: validate_index for veci8 & rm deprecated feature. (#451)
Browse files Browse the repository at this point in the history
Signed-off-by: my-vegetable-has-exploded <wy1109468038@gmail.com>
  • Loading branch information
my-vegetable-has-exploded authored Mar 30, 2024
1 parent 9766d43 commit 6fc8708
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions crates/base/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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(())
Expand Down

0 comments on commit 6fc8708

Please sign in to comment.