OpenAI's Whisper in the browser, run by OnnxStream (WASM)
This is a demo of the WASM build of OnnxStream: Whisper runs fully in the browser without any backend server.
The OnnxStream JS API is very similar to the C++ API: you can specify a model as a series of operations in text format, you can add input tensors, read output tensors etc.
The Whisper ONNX models from the sherpa-onnx project were converted to the text format compatible with OnnxStream using onnx2txt.
Feel free to view the source of this page: it is about 1200 lines of HTML and JS code that demonstrate how to use the API (specifically the "initModel" and "runModel" functions).
or
or