sandrohanea / whisper.net

Whisper.net. Speech to text made simple using Whisper Models
MIT License
534 stars 82 forks source link

API doesn't permit loading native .dylib from non standard location #19

Closed christianscheuer closed 1 year ago

christianscheuer commented 1 year ago

Hi,

Thanks for an awesome library. When looking to incorporate Whisper.net into a product, we would need the ability to load the native .dylib from a location other than where the NativeLibraryLoader is currently trying to find the binary (under runtimes/...).

Would it be possible to make an extension to the API to allow the library user to specify search paths manually? We'd much prefer this over having to fork the library just for this purpose.

sandrohanea commented 1 year ago

Hello @christianscheuer, Thanks for the report :)

Just added: SetLibraryLoader which allows you to set a custom library loader and load the native library from any path you want.

This way, you can create a custom library loader and load the library similar to MacOsLibraryLoader but from any path you want.

christianscheuer commented 1 year ago

Awesome, thank you so much for the speedy response and implementation! From a cursory look on the change, that's exactly what we were hoping for. Do you have any timeline for when this might make it into a public release?

sandrohanea commented 1 year ago

I am planning to create a new public release this weekend and also include latest changes in the native library (whisper.cpp). Will keep you posted!

sandrohanea commented 1 year ago

New version is available on nuget: https://www.nuget.org/packages/Whisper.net/1.2.2