whisper.cpp icon indicating copy to clipboard operation
whisper.cpp copied to clipboard

wasm : update and fix examples

Open ggerganov opened this issue 9 months ago • 1 comments
trafficstars

The Emscripten build for the WASM examples hasn't been maintained for a very long time. There are likely regressions that have been introduced that would need to be fixed.

Last working examples: https://whisper.ggerganov.com

  • Fix WASM builds
  • Update instructions
  • Add CI workflows
  • Host the WASM examples on a new domain and update regularly

ggerganov avatar Feb 04 '25 07:02 ggerganov

I might be interested in this, have done some web dev before in other projects, what do you think if I were to try revamping the current website using JS and WASM?

harvestingmoon avatar Feb 18 '25 15:02 harvestingmoon

@ggerganov I think your suggestion to use github pages for serving the wasm examples will work. I've tried this out on a separate repo and this is the generated github pages, which are generated for each push to main. I'll try this out on whisper.cpp tomorrow and see if we can get it working there as well.

danbev avatar Mar 30 '25 13:03 danbev

Awesome!

ggerganov avatar Mar 30 '25 15:03 ggerganov

@ggerganov Could you enable github pages to be deployed via github actions (I can't do as the settings tab does not show up for me, might be a permission issue):

In Settings -> Pages -> Build and Deployment select the GitHub Actions.

danbev avatar Mar 31 '25 07:03 danbev

Done

ggerganov avatar Mar 31 '25 08:03 ggerganov

The examples are now published here for each push to master: https://ggerganov.github.io/whisper.cpp/

danbev avatar Mar 31 '25 09:03 danbev

I think this issue can be closed, correct?

ggerganov avatar Mar 31 '25 10:03 ggerganov

I think this issue can be closed, correct?

Yep, I think this is completed now 👍

danbev avatar Mar 31 '25 10:03 danbev

There seems to be a problem with the WASM example - when I transcribe longer audio using the tiny model, the processing often stops without any error or notification:

Image

@danbev Can you reproduce on your end?

I am usually able to reproduce by running gb0.wav or gb1.wav from the samples, using 8 threads in a Chrome browser.

ggerganov avatar Apr 03 '25 06:04 ggerganov

@danbev Can you reproduce on your end?

I'll take a look 👍 I've only been testing with the sample jfk.wav which is pretty short.

danbev avatar Apr 03 '25 06:04 danbev

@ggerganov I've tried with various files like gb0.ogg, gb1.ogg, mm1.wav but they all complete. Could you share the file you are using so I can try the exact same one?

This the output from gb1.ogg:

Image

danbev avatar Apr 03 '25 06:04 danbev

Try using the tiny.en (75 MB) model. Here are the samples:

gb0.wav.txt

gb1.wav.txt

(remove the .txt extension)

I am able to reproduce this only in Chrome by transcribing the 2 samples one after the other. Eventually it hangs. I also reproduce it with the old WASM examples at: https://whisper.ggerganov.com, so it is not a new issue.

The strange thing is that it does not happen neither in Safari, nor in Firefox.

Btw, I just noticed the "unknown language" error when using non-en models. This looks like a separate issue.

ggerganov avatar Apr 03 '25 06:04 ggerganov

Thanks, I've tried these but I've not been able to reproduce yet. I'll continue transcribing and see when I run into it.

Eventually it hangs. I also reproduce it with the old WASM examples at: https://whisper.ggerganov.com/, so it is not a new issue.

Ah good to know that, as it might not be cause by the changes to the WebAssembly memory setting in emscripten we made.

Btw, I just noticed the "unknown language" error when using non-en models. This looks like a separate issue.

I noticed this as well for the none .en models. I'll take a look at that too.

danbev avatar Apr 03 '25 06:04 danbev

Thanks, I've tried these but I've not been able to reproduce yet. I'll continue transcribing and see when I run into it.

Ok thanks. It seems very likely that the issue is on my end - will try later today on a different PC to make sure.

ggerganov avatar Apr 03 '25 06:04 ggerganov