Skip to content

Unable to run on Mac - stream.wasm - WebAssembly instantiate CompileError #3739

@saamerm

Description

@saamerm

I tried to follow the instruction in the README provided here: https://github.com/ggml-org/whisper.cpp/tree/master/examples/stream.wasm
In order to make it work on on M1 Mac, I initially installed these two packages:

brew install cmake
brew install emscripten

And then as per the other instructions, I successfully followed these steps:

mkdir build-em && cd build-em
emcmake cmake ..
make -j
python3 examples/server.py

But when I open the page: http://localhost:8000/stream.wasm, I get this error

failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): section was shorter than expected size (87618 bytes expected, 684 decoded) @+696
Aborted(CompileError: WebAssembly.instantiate(): section was shorter than expected size (87618 bytes expected, 684 decoded) @+696)

as you can see in the screenshot:

Image Here's the console logs: ``` stream.wasm/:27 GET http://localhost:8000/coi-serviceworker.js net::ERR_CONNECTION_REFUSED helpers.js:14 failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): section was shorter than expected size (87618 bytes expected, 684 decoded) @+696 helpers.js:14 Aborted(CompileError: WebAssembly.instantiate(): section was shorter than expected size (87618 bytes expected, 684 decoded) @+696) stream.js:1 Uncaught (in promise) RuntimeError: Aborted(CompileError: WebAssembly.instantiate(): section was shorter than expected size (87618 bytes expected, 684 decoded) @+696). Build with -sASSERTIONS for more info. at abort (stream.js:1:6122) at instantiateArrayBuffer (stream.js:1:1359798) at async createWasm (stream.js:1:1360753) abort @ stream.js:1 instantiateArrayBuffer @ stream.js:1 await in instantiateArrayBuffer instantiateAsync @ stream.js:1 createWasm @ stream.js:1 (anonymous) @ stream.js:1 ``` Image

Where did I mess up?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions