fix: add validator for cosine metric with int8 (#209)
This commit is contained in:
parent
23ca093fc7
commit
ba86c1663d
|
|
@ -160,6 +160,16 @@ Status FieldSchema::validate() const {
|
|||
"types according to the IP metric");
|
||||
}
|
||||
}
|
||||
if (vector_index_params->metric_type() == MetricType::COSINE) {
|
||||
if (data_type_ != DataType::VECTOR_FP16 &&
|
||||
data_type_ != DataType::VECTOR_FP32) {
|
||||
return Status::InvalidArgument(
|
||||
"schema validate failed: cosine metric only supports FP32/FP16 "
|
||||
"data types, but field[",
|
||||
name_, "]'s data type is ",
|
||||
DataTypeCodeBook::AsString(data_type_));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (index_params_) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue