sandrohanea / whisper.net

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

Unable to find an entry point named 'whisper_init_from_file_no_state' in DLL 'whisper' #56

Closed 7702244 closed 1 year ago

7702244 commented 1 year ago

I get an error when initializing WhisperFactory:

System.EntryPointNotFoundException: Unable to find an entry point named 'whisper_init_from_file_no_state' in DLL 'whisper'.
   at Whisper.net.Native.NativeMethods.whisper_init_from_file_no_state(String path)
   at Whisper.net.Internals.ModelLoader.WhisperProcessorModelFileLoader.LoadNativeContext()
   at Whisper.net.WhisperFactory..ctor(IWhisperProcessorModelLoader loader, Boolean delayInit, String libraryPath, Boolean bypassLoading)
   at Whisper.net.WhisperFactory.FromPath(String path, Boolean delayInitialization, String libraryPath, Boolean bypassLoading)

Tested with both version 1.4.3 and 1.4.2 on Windows Server 2022 x64 AMD EPYC.

            using (var whisperFactory = WhisperFactory.FromPath(modelPath)) // this gives exception
            {
                 // ...
            }
sandrohanea commented 1 year ago

Hello @7702244,

Did you also install the Runtime package with the same version?

e.g

    <PackageReference Include="Whisper.net" Version="1.4.3" />
    <PackageReference Include="Whisper.net.Runtime" Version="1.4.3" />
7702244 commented 1 year ago

Hello @sandrohanea,

Yes, of course. I installed both packages of the same version.

sandrohanea commented 1 year ago

I just tried it on win-x64 and it was working as expected (we also have CI for it).

Can you, please, try to install: https://aka.ms/vs/17/release/vc_redist.x64.exe just to make sure you have the VC Redistributable and if it's still not working, can you, please, confirm if you're using any example from this repo or you have some custom implementation?

In case of a custom implementation, please, try with https://github.com/sandrohanea/whisper.net/tree/main/examples/SimpleWhisperExample

7702244 commented 1 year ago

I found where the problem was. The error occurs if you add to the project nuget package "WhisperNet", which works with the GPU.

sandrohanea commented 1 year ago

Yes, that's a different package (not related to Whisper.net): https://github.com/Const-me/Whisper