question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to load native whisper library

See original GitHub issue

I can’t get it work, I keep getting error “Failed to load native whisper library”. Not sure if I’m supposed to do something rather then adding packages in project, downloading model and creating processor. I’m doing exactly what is done in Simple example. The error appears at following line: using var whisperFactory = WhisperFactory.FromPath("ggml-base.bin");

I’m integrating into dotnet core 5 application running on linux-x64 machine. Should I manually run whisper library or add it somewhere? Not sure that I understand the process at all…

`

    // This section detects whether the "ggml-base.bin" file exists in our project disk. If it doesn't, it downloads it from the internet
    if (!System.IO.File.Exists(modelFileName))
    {
      await DownloadModel(modelFileName, ggmlType);
    }

    // This section creates the whisperFactory object which is used to create the processor object.
    using var whisperFactory = WhisperFactory.FromPath("ggml-base.bin");

    // This section creates the processor object which is used to process the audio file, it uses language `auto` to detect the language of the audio file.
    using var processor = whisperFactory.CreateBuilder()
        .WithLanguage("auto")
        .Build();

`

Issue Analytics

  • State:open
  • Created 4 months ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
csharpfritzcommented, Jun 16, 2023

In working with containers, I found that I needed to be sure to include the latest GLIBC libraries, and using a base image of Ubuntu 22.04 (Jammy) solved this problem for me

0reactions
philippjbauercommented, Jul 3, 2023

@sandrohanea I got my application working without problems on macOS Ventura, Ubuntu 20.22 and Windows 11 ARM64.

Windows 11 on an x64 machine unfortunately fails with:

System.Exception: Failed to load native whisper library. Error: A dynamic link library (DLL) initialization routine failed.

I followed all suggestions in this and the other threads except for hunting down a GLIBC since it only relates to Linux as far as I can tell.

The suggestion to use a custom loader doesn’t work with the provided code because the LoadLibraryEx method is missing a 3rd parameter and I have no idea what a valid uint dwFlags value might be. I tried 0 and 1 just to try but it didn’t work with those.

I’ve been trying the “Simple” example with version 1.4.6 of the project packages on an up-to-date install of Win 11 that has VS 2022 installed (including C++ development package).

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError: Failed to load audio: dyld[58520]: Library not ...
I notice now that if I run ffmpeg --version I also get an error: dyld[59959]: Library not loaded: /opt/homebrew/opt/rav1e/lib/librav1e.0.5.dylib ...
Read more >
Failed to load native whisper library. #11 - bytemeta
When trying to build the WhisperProcessor I get the following error: 'Failed to load native whisper library.' image I am using Windows 11...
Read more >
Error audio loading when runing Whisper Open AI model
I ran into the same problem and it appeared to be just having the audio file named differently. In code I used *.mp3...
Read more >
Using Whisper for speech recognition in React Native
Learn how to use Whisper, a speech recognition tool, to create a speech-to-text application with React Native.
Read more >
Faster Whisper: Could not load library cudnn - Beginners
Hi there, I've installed Whisper from OpenAI and it works. I then installed Faster Whisper, it worked, and then tried WhisperX, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found