feat(ndarray-safetensors): add tensor_by_index method for SafeArraysView
Some checks failed
build / checks-matrix (push) Successful in 19m24s
build / codecov (push) Failing after 19m27s
docs / docs (push) Failing after 28m51s
build / checks-build (push) Has been cancelled

This commit is contained in:
uttarayan21
2025-08-20 16:05:18 +05:30
parent 97f64e7e10
commit f8122892e0
3 changed files with 19 additions and 3 deletions

View File

@@ -551,10 +551,10 @@ fn add_sqlite_cosine_similarity(db: &Connection) -> Result<()> {
.map_err(|e| rusqlite::Error::UserFunctionError(e.into()))?;
let array_view_1 = array_1_st
.tensor::<f32, ndarray::Ix1>("embedding")
.tensor_by_index::<f32, ndarray::Ix1>(0)
.map_err(|e| rusqlite::Error::UserFunctionError(e.into()))?;
let array_view_2 = array_2_st
.tensor::<f32, ndarray::Ix1>("embedding")
.tensor_by_index::<f32, ndarray::Ix1>(0)
.map_err(|e| rusqlite::Error::UserFunctionError(e.into()))?;
let similarity = array_view_1

View File

@@ -130,7 +130,7 @@ where
.attach_printable("Failed to detect faces")?;
// Store image and face detections in database if requested
let (image_id, face_ids) = if let Some(ref database) = db {
let (_image_id, face_ids) = if let Some(ref database) = db {
let image_path = detect.image.to_string_lossy();
let img_id = database
.store_image(&image_path, image_width, image_height)