feat(ndarray-safetensors): add tensor_by_index method for SafeArraysView
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user