mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-06-18 23:08:08 +00:00
command.wasm : add voice assistant example for the Web (#171)
Same as the command-line tool "command", but runs in the browser Also, added helper script "extra/deploy-wasm.sh" and fixed some timing constants for the WASM examples.
This commit is contained in:
30
extra/deploy-wasm.sh
Executable file
30
extra/deploy-wasm.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This is a helper script to deploy all WebAssembly examples to my node
|
||||
# Run from the build directory:
|
||||
#
|
||||
# cd build-em
|
||||
# ../extra/deploy-wasm.sh
|
||||
#
|
||||
|
||||
# check if emcmake is available
|
||||
if ! command -v emcmake &> /dev/null
|
||||
then
|
||||
echo "Error: emscripten environment is not set up"
|
||||
exit
|
||||
fi
|
||||
|
||||
emcmake cmake .. && make -j
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: build failed"
|
||||
exit
|
||||
fi
|
||||
|
||||
# copy all wasm files to the node
|
||||
scp bin/whisper.wasm/* root@linode0:/var/www/html/whisper/ && scp bin/libwhisper.worker.js root@linode0:/var/www/html/whisper/
|
||||
scp bin/stream.wasm/* root@linode0:/var/www/html/whisper/stream/ && scp bin/libstream.worker.js root@linode0:/var/www/html/whisper/stream/
|
||||
scp bin/command.wasm/* root@linode0:/var/www/html/whisper/command/ && scp bin/libcommand.worker.js root@linode0:/var/www/html/whisper/command/
|
||||
scp bin/talk.wasm/* root@linode0:/var/www/html/whisper/talk/ && scp bin/libtalk.worker.js root@linode0:/var/www/html/whisper/talk/
|
||||
|
||||
echo "Done"
|
||||
exit
|
Reference in New Issue
Block a user