alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.7k stars 1.08k forks source link

C# GPU inferencing #1305

Closed kitsim93 closed 1 year ago

kitsim93 commented 1 year ago

Hello. I compiled Vosk 0.3.45 with Kaldi environment to use GPU in c#. All was good to make the object file and shared library file. Once I put the new library to nuget folder and when I compile the new nuget package, I realized that csharp src file didn't have the batchModel,cs and batchRecognizer.cs. As a result, when I call "GpuInit()", it looks okay because I can see the relevant log message and confirm via "nvidia-smi". But because of the lack of BatchModel and BatchRecognizer, it's not working at all. (all operation runs in CPU core). Can you please add the BatchModel.cs and BatchRecognizer.cs in repository? Thanks !!!

nshmyrev commented 1 year ago

Please add them yourself and submit a pull request. It is very simple, 20 lines of code.

mason-acronode commented 1 year ago

I created the PR. c# supports GPU inference #1307

nshmyrev commented 1 year ago

Great thanks a lot!