You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LD_LIBRARY_PATH when run with the commands in the docs will actually result in /opt/homebrew/Cellar/pytorch/2.2.0_6/lib: instead of /opt/homebrew/Cellar/pytorch/2.2.0_6/lib as mentioned here. I tried both and they both fail to build.
The text was updated successfully, but these errors were encountered:
hkfi
changed the title
Unable to build when using rust-bert as a dependency in another Rust project on M2 Mac
Unable to build when using rust-bert as a dependency in another Rust project on M2 Mac Sonoma 14.5
Jul 17, 2024
Turns out setting the LIBTORCH and LD__LIBRARY_PATH variables as mentioned in the docs is no longer necessary as of two weeks ago due to an update adding the features=["download-libtorch] flag to the tch dependency.
I managed to get a fresh Rust project to compile with rust-bert as a dependency by adding the same flag, so the dep looks like this:
rust-bert = {version = "0.22.0", features = ["download-libtorch"]}
It will not work with rust-bert = "0.22.0", and trying to point LIBTORCH to the pytorch that was installed via Homebrew like mentioned in the docs like:
I followed the steps mentioned in the docs
I ran the commands mentioned:
I am able to run
cargo run --example sentence_embeddings
.However, when creating a new Rust project and adding
rust-bert = "0.22.0"
as a dependency and runningcargo build
, I run into the following error:I checked that the variables
LIBTORCH
andLD_LIBRARY_PATH
were set correctly with echo:LD_LIBRARY_PATH when run with the commands in the docs will actually result in
/opt/homebrew/Cellar/pytorch/2.2.0_6/lib:
instead of/opt/homebrew/Cellar/pytorch/2.2.0_6/lib
as mentioned here. I tried both and they both fail to build.The text was updated successfully, but these errors were encountered: