Skip to content

Changes to enable rust bindings#5

Open
ervanalb wants to merge 4 commits intom1el:masterfrom
ervanalb:changes-for-rust-bindings
Open

Changes to enable rust bindings#5
ervanalb wants to merge 4 commits intom1el:masterfrom
ervanalb:changes-for-rust-bindings

Conversation

@ervanalb
Copy link
Copy Markdown

I forked this project so that I could write rust bindings for it (https://crates.io/crates/nemotron-asr). These are the changes that I made on my fork. I figured I might as well submit them upstream to see if you were interested in including them.

This PR is split up into 4 commits, each one being a fairly isolated change:

  1. Make nemotron-asr.ccp agnostic to the GGML backend -- this change allows nemotron-asr.cpp to target any GGML backend, not just CPU, CUDA, and Metal. I personally tested Vulkan support which works great (substantially faster than CPU.) This also adds support for GGML_BACKEND_DL.
  2. Add C interface for FFI -- I rewrote some of the C++ public interfaces in a C-style, allowing me to build a library libnemotron_asr.so / libnemotron_asr.a.
  3. Add GGML as a git submodule -- this seems to be the standard for other projects using ggml (see for example, parakeet.cpp), and it simplifies the process of making a vendored build.
  4. Enable static linkage and overriding variables in Makefile -- Rust programs are generally statically linked, so I wanted to allow for that option for libnemotron_asr and nemotron-asr.cpp. If ggml is built statically, it will be linked statically. Otherwise it will be linked dynamically.

Let me know if you'd like any changes to this PR--and it's also fine if you don't want to merge it at all. Thanks for this library, it's been working great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant