-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Module not loading (whisper.wasm) #88
Comments
In general, it is a bit tricky to run multi-threaded WebAssembly code nowadays. In short, sometime in 2018 it was decided to disable shared memory in the browser due to Spectre attack [0, see section "Security Requirements"]. Later, it became possible to use shared memory again, but your http server has to provide CORS response headers when serving the page. For my WebAssembly projects, I have an NGINX server configured to serve the correct headers and have been using it ever since:
I haven't tried to make it work on localhost, but a quick google search suggests the following solution: https://stackoverflow.com/questions/70535752/enable-sharedarraybuffer-on-localhost Maybe you can give it a try and see if it helps. |
I got it, thanks! I will try to work around this in localhost for the sake of science, but usually HTML is sitting on a server anyway and it's not a problem to run a local server in any case. Good to know that this is kind of s CORS issue/feature so I know where to look into. |
Thanks for whisper.cpp, using it successfully on command line. Now trying web stream, compiles successfully, apparently.
I couldn't get the models to download into IndexDB, cors problem, so I downloaded by hand and put them on localhost. Hope this helps someone else:
Thanks again. |
Hello, |
|
ERROR
I get two errors out of the whisper.wasm when running locally an instance compiled myself: "Uncaught TypeError: Module.FS_createDataFile is not a function at reader.onload (index.html:280:28)" and "Uncaught TypeError: Module.init is not a function at onProcess (index.html:449:39) at HTMLButtonElement.onclick (index.html:157:61)". The problem seems to lie in loading Module but I couldn't figure out how to fix it.
REPRODUCTION & SYMPTOMS
I compiled the web version using Mac OS X Monterey 12.6. All went fine with the compilation. Then I copied index.html, whisper.js and libwhisper.worker.js in same folder. All files are in the root of the same folder. But when I I choose file for Model or Audio file inputs, I get the errors mentioned above (and in the screenshot). Is this a potential bug or am I doing something wrong?
DIAGNOSABLE
The text was updated successfully, but these errors were encountered: