Anush008/fastembed-rs

Offline models

jcorrie opened this issue ยท 7 comments

Following the version 3 changes, I can no longer run the program while my machine is offliine (even though the model is cached, the crate still looks to perform a check against the hosted model). Could this be changed so that, if the machine is offline, it will default to the cached model?

thread 'main' panicked at src\embedding\mod.rs:127:6:
Can't load model: request error: https://huggingface.co/api/models/Qdrant/all-MiniLM-L6-v2-onnx/revision/main: Dns Failed: resolve dns name 'huggingface.co:443': No such host is known. (os error 11001)

Caused by:
0: https://huggingface.co/api/models/Qdrant/all-MiniLM-L6-v2-onnx/revision/main: Dns Failed: resolve dns name 'huggingface.co:443': No such host is known. (os error 11001)
1: No such host is known. (os error 11001)
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Hello @jcorrie.
I'll try to take a look.

It's because of checking https://github.com/Anush008/fastembed-rs/blob/main/src%2Flib.rs#L169-L176, which requires a network call.

Thanks for looking into this. I've never contributed before, but OK for me to have a stab at a PR to make this fallback to local if no connection?

Absolutely. Contributions are always ๐Ÿค—.

https://github.com/Anush008/fastembed-rs/blob/main/src%2Flib.rs#L178

Checks locally first then does a network call.

๐ŸŽ‰ This issue has been resolved in version 3.1.4 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

I need to check whether this issue is still fixed given the different folder structure of the NomicEmbedTextV1 and BGESmallZHV15 models.