guillaume-be / rust-bert

Rust native ready-to-use NLP pipelines and transformer-based models (BERT, DistilBERT, GPT2,...)
https://docs.rs/crate/rust-bert
Apache License 2.0
2.6k stars 215 forks source link

Can I use this lib with onnx but without libtorch? #419

Open Andreybest opened 1 year ago

Andreybest commented 1 year ago

Hey! I trying to do some task with t5 model. But the issue is that I can't put 600mb of libtorch in my project. Question: Is it possible in this lib to use onnx without downloading libtorch? Thanks!

guillaume-be commented 11 months ago

Hello @Andreybest ,

Unfortunately the torch dependency is still needed by the library as we use it for the pre/post-processing operations. Making the dependency optional would require re-writing a ndarray (or other) version of all the pipelines. This represents a significant amount of work (especially for the text generation pipelines) and I am not sure to have the capacity in the near future.

Would you be willing to work on such a conversion?