examples : add wchess.wasm to wasm examples build (#3443)
* examples : add wchess.wasm to wasm examples build This commit add the wchess.wasm example to the wasm examples that are deployed to https://ggml.ai/whisper.cpp. Refs: https://github.com/ggml-org/whisper.cpp/issues/3434#issuecomment-3346980420
This commit is contained in:
parent
0b3587acdd
commit
5904d00dbb
|
|
@ -67,6 +67,12 @@ jobs:
|
||||||
cp ${build_dir}/stream.wasm/{index.html,stream.js,helpers.js} ${target_dir}
|
cp ${build_dir}/stream.wasm/{index.html,stream.js,helpers.js} ${target_dir}
|
||||||
cp ${build_dir}/libstream.js ${target_dir}
|
cp ${build_dir}/libstream.js ${target_dir}
|
||||||
|
|
||||||
|
# wchess.wasm
|
||||||
|
target_dir=staging/wchess.wasm
|
||||||
|
mkdir -p ${target_dir}
|
||||||
|
cp -r ${build_dir}/wchess.wasm/{index.html,css,img,js} ${target_dir}
|
||||||
|
cp ${build_dir}/wchess.wasm.js ${target_dir}
|
||||||
|
|
||||||
# whisper.wasm (this will be the main example page)
|
# whisper.wasm (this will be the main example page)
|
||||||
target_dir=staging
|
target_dir=staging
|
||||||
mkdir -p ${target_dir}
|
mkdir -p ${target_dir}
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,7 @@ if (EMSCRIPTEN)
|
||||||
add_subdirectory(stream.wasm)
|
add_subdirectory(stream.wasm)
|
||||||
add_subdirectory(command.wasm)
|
add_subdirectory(command.wasm)
|
||||||
add_subdirectory(bench.wasm)
|
add_subdirectory(bench.wasm)
|
||||||
|
add_subdirectory(wchess)
|
||||||
elseif(CMAKE_JS_VERSION)
|
elseif(CMAKE_JS_VERSION)
|
||||||
add_subdirectory(addon.node)
|
add_subdirectory(addon.node)
|
||||||
else()
|
else()
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
<a href="../bench.wasm/">bench</a> |
|
<a href="../bench.wasm/">bench</a> |
|
||||||
<a href="../stream.wasm">stream</a> |
|
<a href="../stream.wasm">stream</a> |
|
||||||
<a href="../command.wasm/">command</a> |
|
<a href="../command.wasm/">command</a> |
|
||||||
|
<a href="../wchess.wasm/">wchess</a> |
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
<a href="../bench.wasm/">bench</a> |
|
<a href="../bench.wasm/">bench</a> |
|
||||||
<a href="../stream.wasm">stream</a> |
|
<a href="../stream.wasm">stream</a> |
|
||||||
<a href="../command.wasm/">command</a> |
|
<a href="../command.wasm/">command</a> |
|
||||||
|
<a href="../wchess.wasm/">wchess</a> |
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,12 @@ class CustomHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
|
||||||
|
|
||||||
elif actual_path == '/':
|
elif actual_path == '/':
|
||||||
self.path = '/whisper.wasm/index.html'
|
self.path = '/whisper.wasm/index.html'
|
||||||
elif actual_path.startswith('/bench.wasm/') or actual_path.startswith('/command.wasm/') or actual_path.startswith('/stream.wasm/'):
|
elif any(actual_path.startswith(prefix) for prefix in (
|
||||||
|
'/bench.wasm/',
|
||||||
|
'/command.wasm/',
|
||||||
|
'/stream.wasm/',
|
||||||
|
'/wchess.wasm/'
|
||||||
|
)):
|
||||||
# Keep the path as is, just remove the context root
|
# Keep the path as is, just remove the context root
|
||||||
self.path = actual_path
|
self.path = actual_path
|
||||||
# For all other paths under the context root
|
# For all other paths under the context root
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
<a href="../bench.wasm/">bench</a> |
|
<a href="../bench.wasm/">bench</a> |
|
||||||
<a href="../stream.wasm">stream</a> |
|
<a href="../stream.wasm">stream</a> |
|
||||||
<a href="../command.wasm/">command</a> |
|
<a href="../command.wasm/">command</a> |
|
||||||
|
<a href="../wchess.wasm/">wchess</a> |
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Voice-controlled chess using Whisper
|
Voice-controlled chess using Whisper
|
||||||
|
|
||||||
Online demo: https://whisper.ggerganov.com/wchess/
|
Online demo: https://ggml.ai/whisper.cpp/
|
||||||
|
|
||||||
https://github.com/ggerganov/whisper.cpp/assets/1991296/c2b2f03c-9684-49f3-8106-357d2d4e67fa
|
https://github.com/ggerganov/whisper.cpp/assets/1991296/c2b2f03c-9684-49f3-8106-357d2d4e67fa
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,10 @@ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS " \
|
||||||
-s INITIAL_MEMORY=1024MB \
|
-s INITIAL_MEMORY=1024MB \
|
||||||
-s TOTAL_MEMORY=1024MB \
|
-s TOTAL_MEMORY=1024MB \
|
||||||
-s FORCE_FILESYSTEM=1 \
|
-s FORCE_FILESYSTEM=1 \
|
||||||
-s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap', 'HEAPU8']]\" \
|
-s EXPORTED_RUNTIME_METHODS=\"['print', 'printErr', 'ccall', 'cwrap', 'HEAPU8']\" \
|
||||||
${EXTRA_FLAGS} \
|
${EXTRA_FLAGS} \
|
||||||
")
|
")
|
||||||
|
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${TARGET} POST_BUILD
|
TARGET ${TARGET} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
|
|
||||||
|
|
@ -120,11 +120,10 @@
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<b>More examples:</b>
|
<b>More examples:</b>
|
||||||
<a href="https://whisper.ggerganov.com/">main</a> |
|
<a href="../">main</a> |
|
||||||
<a href="https://whisper.ggerganov.com/bench">bench</a> |
|
<a href="../bench.wasm">bench</a> |
|
||||||
<a href="https://whisper.ggerganov.com/stream">stream</a> |
|
<a href="../stream.wasm">stream</a> |
|
||||||
<a href="https://whisper.ggerganov.com/command">command</a> |
|
<a href="../command.wasm">command</a> |
|
||||||
<a href="https://whisper.ggerganov.com/talk">talk</a> |
|
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@
|
||||||
<a href="bench.wasm/">bench</a> |
|
<a href="bench.wasm/">bench</a> |
|
||||||
<a href="stream.wasm">stream</a> |
|
<a href="stream.wasm">stream</a> |
|
||||||
<a href="command.wasm/">command</a> |
|
<a href="command.wasm/">command</a> |
|
||||||
|
<a href="wchess.wasm/">wchess</a> |
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue