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

fastembed 3 panic on Windows 11: Failed to retrieve onnx/model.onnx #78

Closed zhaoyii closed 3 months ago

zhaoyii commented 3 months ago

The program panics while attempting to load the onnx/model.onnx model,When running fastembed 3 on Windows 11 with Rust 1.78.0.

thread 'main' panicked at \fastembed-3.9.0\src\text_embedding.rs:130:33:
Failed to retrieve onnx/model.onnx

Whereas it runs smoothly with fastembed 2.

Anush008 commented 3 months ago

Can you try clearing the .fastembed_cache directory?

zhaoyii commented 3 months ago

The .fastembed_cache directory was not found. Due to some network issues, direct access to hugginface.co is not possible. The version of ureq relied upon by hf-hub does not support configuring proxy parameters such as HTTPS_PROXY through environment variables, preventing the download of models.

Could you please instruct me on how to manually download the model to the cache folder? I attempted this, but it might not be in the correct format, leading to a failure to run.

By the way, to clarify, this issue is not related to the operating system but is caused by network reasons. huggingface.co is not accessible from mainland China, and this is a common issue faced by developers in mainland China.

Anush008 commented 3 months ago

You can just download the model repo from the HuggingFace site and set the value for the cache_dir path when initializing TextEmbedding.

zhaoyii commented 3 months ago

Thank you for your answer. hf-hub seems to be not very user-friendly. I solved the problem by using the huggingface_hub library in Python to download the model.