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

fix: full offline model retrieval (from cache) #33

Closed jcorrie closed 7 months ago

jcorrie commented 7 months ago

This fixes #30. Previously, an attempt to access a model while offline would fail, even if that model was already cached. This is because a request was made to the remote hugging face repo to obtain the file path of the .onnx model. This change implements a fallback search over the cache dir to find the relevant model file. It there are multiple snapshots for a particular model, it would not know which is the 'correct' file - this is unlikely to be a significant problem as this is only intended to be a fallback for DX purposes.

Also exposes new public function "get_model_info" - this is primarily to give users a convenient way of accessing model dimensions.

Anush008 commented 7 months ago

Hi @jcorrie. This is fantastic. I'm trying it out now.

Anush008 commented 7 months ago

Thanks @jcorrie.

github-actions[bot] commented 7 months ago

:tada: This PR is included in version 3.1.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: