Anush008 / fastembed-rs

Library for generating vector embeddings, reranking in Rust
https://docs.rs/fastembed
Apache License 2.0
264 stars 36 forks source link

Cloning of Input Documents #65

Closed smelm closed 4 months ago

smelm commented 4 months ago

First of, thanks for the great work.

I am wondering why the API of embed takes ownership of the texts vector instead of borrowing it. I tried it locally and it works just as well with a reference which removes the need of cloning as well.

https://github.com/Anush008/fastembed-rs/blob/044f3eb0d7e91f56b31b79dc714b4fb67fa58684/src/text_embedding.rs#L225

Anush008 commented 4 months ago

Hi @smelm. Thanks for raising this issue. Unfortunately, switching now will be a breaking change.