coqui-ai / STT

🐸STT - The deep learning toolkit for Speech-to-Text. Training and deploying STT models has never been so easy.
https://coqui.ai
Mozilla Public License 2.0
2.23k stars 270 forks source link

Feature request: Support running WASM in web worker #2293

Open johns10 opened 2 years ago

johns10 commented 2 years ago

Is your feature request related to a problem? Please describe. If you would like to use the wasm client, and want to instantiate STT, it involves downloading or loading multiple 100+ mb files. If you do it in the main thread, it locks up the UI. I don't believe this package currently supports running in a web worker, because the web context will attempt to create the URL of the .wasm/.worker file using the URL module, which isn't available in web workers.

Describe the solution you'd like Allow passing in the url to the STT() function, overriding calls to the URL module.

Describe alternatives you've considered Personally, I've hacked stt_wasm.js to take a url arg, and removed the calls to URL. One could potentially provide an implementation of URL for use in stt_wasm? I'm not so deep in javascript that I know how to do it.

wasertech commented 1 year ago

Checkout https://github.com/coqui-ai/STT-examples/tree/r1.0/wasm