thewh1teagle / sherpa-rs

Rust bindings to https://github.com/k2-fsa/sherpa-onnx
MIT License
52 stars 11 forks source link

The current compilation dependency is to directly rely on the source code repository and then compile it yourself, is there a plan to provide a way to directly rely on the compiled dll? #16

Closed ghjdegithub closed 1 month ago

ghjdegithub commented 1 month ago

I mean the source code that depends on sherpa-onnx, not the already compiled library

thewh1teagle commented 1 month ago

This approach isn't typical in Rust, and it's not something people usually do. However, I like the idea—it could save unnecessary compilations and time. I'll look into enabling all the features in sherpa-onnx, and then I can distribute a precompiled crate with the bindings already compiled.

thewh1teagle commented 1 month ago

See https://github.com/thewh1teagle/sherpa-rs/blob/main/BUILDING.md#use-prebuild-sherpa-onnx-for-fast-compilation With this approach you can build sherpa-rs in few seconds as it uses prebuilt sherpa-onnx. Works on macOS/Linux/Windows.

I might automate this in the library and enable it by default in the future (with feature flag), but I'm still undecided. Enabling it could lead to unexpected network or linking errors. Additionally, some binaries, like those for Windows, are quite large—around 300MB since the binaries of sherpa-onnx included in the zipped package.

ghjdegithub commented 1 month ago

See https://github.com/thewh1teagle/sherpa-rs/blob/main/BUILDING.md#use-prebuild-sherpa-onnx-for-fast-compilation With this approach you can build sherpa-rs in few seconds as it uses prebuilt sherpa-onnx. Works on macOS/Linux/Windows.

I might automate this in the library and enable it by default in the future (with feature flag), but I'm still undecided. Enabling it could lead to unexpected network or linking errors. Additionally, some binaries, like those for Windows, are quite large—around 300MB since the binaries of sherpa-onnx included in the zipped package.

Yes, it takes me a very long time to recompile each time now, that is to compile sherpa-onnx and sherpa-rs, very time consuming.

thewh1teagle commented 1 month ago

Added download-binaries feature to latest release (enabled by default). Now sherpa-rs relay on compiled sherpa-onnx. also, it caches it across different projects! It took to me 10 seconds to compile sherpa-rs on macOS.