Closed failable closed 3 years ago
hello @liebkne ,
I unfortunately do not have a mac to do further testing, but I included macOS to the list of targets for the continuous integration. I just ran the pipeline, and the build seems to be working (see https://github.com/guillaume-be/rust-bert/runs/2040286210?check_suite_focus=true).
You mention that you tried building tch-rs
and it works fine. My guess is that by building tch-rs
, you automatically downloaded the matching version of Libtorch. I see that yesterday, the tch-rs
author pushed to master some changes updating the version of Libtorch to 1.8. This library uses the latest published version of tch-rs
that relies on libtorch 1.7. By building rust-bert
, I guess you are trying to use the version of tch-rs
that expects Libtorch 1.7 with Libtorch 1.8.
Could you try deleting your current libtorch installation (/Users/user/.local/libtorch
) and try to build the library again? If the automatic download does not work, please make sure you download Libtorch 1.7 before building again.
Please let me know how this work.
Hi @guillaume-be ,
I installed libtorch
1.8.0 manually yesterday as I saw this. I thought torch-sys
is expecting 1.8.0.
Followed you advice, I manually downgraded libtorch
to 1.7.1 and everything just fine. Thank you! Maybe we should mention this somewhere?
I have one more question, how I can get my local version rust_model.ot
of pretrained weights?
Update:
I notice that the ot
model is mentioned in the issues of tch
library. I guess I should use tch
to convert the model pt
file.
Update again...
I should the the utils
directory and this issue more carefully! 😅
Unfortunately pyTorch has yanked the 1.7.0 and 1.7.1 libtorch binaries.
@bhickey These versions are indeed no longer listed on their website, but can still be download by modifying the URL provided on their homepage with the target version/OS.
For example:
libtorch 1.7
(win) with CPU only:
https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-1.7.0%2Bcpu.ziplibtorch 1.7
(win) with CU101:
https://download.pytorch.org/libtorch/cu101/libtorch-win-shared-with-deps-1.7.0%2Bcu101.ziplibtorch 1.7
(linux) with CPU only:
https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-1.7.0%2Bcpu.ziplibtorch 1.7
(linux) with CU101:
https://download.pytorch.org/libtorch/cu101/libtorch-shared-with-deps-1.7.0%2Bcu101.zipI will push an update to libtorch 1.8.1 in the next few days.
@liebkne could you please share the way you set up your environment variables for running rust-bert on mac? Did you just follow the Linux instructions but using $DYLD_LIBRARY_PATH instead of $LD_LIBRARY_PATH?
@paulbricman Hi, IIRC, I did something like
lib=$(rustc --print sysroot)/lib
for f in "$LIBTORCH/lib"/*.dylib
do
ln -sv "$f" "$lib/$(basename $f)"
done
to link the libraries to Rust. Setting *_LIBRARY_PATH
did not help and I don't know why cargo failed to find them. I'm a Rust newbie and don't find any better solution right now.
Huh, interesting. Thanks so much for sharing! I'll try it soon and edit this with the outcome.
Hi, I'd like to build
rust-bert
on my Mac but failed. However, I successfully runcargo build
in thetsh-rs
repo.Below is the error output, do you have any suggestion? Thanks!