sandrohanea / whisper.net

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

Unhandled exception. System.EntryPointNotFoundException: Unable to find an entry point named 'whisper_log_set' in DLL 'whisper'. #139

Closed KANDURISHOURI closed 11 months ago

KANDURISHOURI commented 11 months ago

The .net implementation of whisper worked well with examples. I tried running Simple and other examples that gave a pretty accurate response for the audio files.

When I am trying to create a new application, am getting an unhandled exception. Please find the stack trace below and would really appreciate any advice on this topic. I had installed both Whisper.net and Whisper.net.Runtime of the 1.5.0 version and just consumed the example code of Simple in my application.

Stack Trace: Unhandled exception. System.EntryPointNotFoundException: Unable to find an entry point named 'whisper_log_set' in DLL 'whisper'. at Whisper.net.Native.NativeMethods.whisper_log_set(IntPtr logCallback, IntPtr user_data) at Whisper.net.Logger.LogProvider.InitializeLogging() at Whisper.net.WhisperFactory.<>c.<.cctor>b__11_0() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at System.Lazy1.get_Value() 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, Boolean useGpu) at WhisperTest.Program.Main(String[] args) in E:\AxisCades\Project_SpeechRecognition.Net\Tests\WhisperTest\Program.cs:line 30 at WhisperTest.Program.

(String[] args)

sandrohanea commented 11 months ago

Hello @KANDURISHOURI,

That exception looks like the runtime was loaded correctly but with a different version (e.g. 1.4.7) which doesn't have whisper_log_set native method.

If you confirm that you have installed Whisper.net.Runtime 1.5.0, I recommend you the following steps:

  1. Delete obj and bin of your solution and rebuild => maybe some different version is cached somewhere?
  2. Retry to run the app.
  3. If still get the error, depending on your OS, check the runtimes folder (e.g. bin/Debug/net8.0/runtimes/win-x64/whisper.dll) and try to check with some dependency walker if you have some issue with it and/or if it contains that entrypoint (whisper_log_set).
KANDURISHOURI commented 11 months ago

Hi, That worked. Thank you!