Skip to content

Commit fd99ece

Browse files
fraxy-vggerganov
andauthored
wchess : whisper assisted chess (#1595)
* wchess: whisper assisted chess * wchess: fix allowed moves in check * wchess: touchstart, touchend events * wchess: css, disabled button * wchess : html touches * wchess : minor fixes and code style * wchess : bump encoder context to 1280 * wchess : index.html * wchess : fix CI warnings * wchess : add array header * wchess : build static library * wchess : display grammar * wchess : update UX * wchess : add comment * wchess : add README --------- Co-authored-by: Georgi Gerganov <[email protected]>
1 parent 8171e62 commit fd99ece

38 files changed

+4233
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ Some of the examples are even ported to run in the browser using WebAssembly. Ch
770770
| [bench](examples/bench) | [bench.wasm](examples/bench.wasm) | Benchmark the performance of Whisper on your machine |
771771
| [stream](examples/stream) | [stream.wasm](examples/stream.wasm) | Real-time transcription of raw microphone capture |
772772
| [command](examples/command) | [command.wasm](examples/command.wasm) | Basic voice assistant example for receiving voice commands from the mic |
773+
| [wchess](examples/wchess) | [wchess.wasm](examples/wchess) | Voice-controlled chess |
773774
| [talk](examples/talk) | [talk.wasm](examples/talk.wasm) | Talk with a GPT-2 bot |
774775
| [talk-llama](examples/talk-llama) | | Talk with a LLaMA bot |
775776
| [whisper.objc](examples/whisper.objc) | | iOS mobile application using whisper.cpp |

bindings/javascript/whisper.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ else()
7373
add_subdirectory(talk-llama)
7474
add_subdirectory(lsp)
7575
endif()
76+
77+
add_subdirectory(wchess)

examples/helpers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var printTextarea = (function() {
2222
async function clearCache() {
2323
if (confirm('Are you sure you want to clear the cache?\nAll the models will be downloaded again.')) {
2424
indexedDB.deleteDatabase(dbName);
25+
location.reload();
2526
}
2627
}
2728

examples/wchess/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set(CMAKE_CXX_STANDARD 11)
2+
3+
add_subdirectory(libwchess)
4+
5+
if (EMSCRIPTEN)
6+
add_subdirectory(wchess.wasm)
7+
else()
8+
add_subdirectory(wchess.cmd)
9+
endif()

examples/wchess/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# wchess.wasm
2+
3+
Voice-controlled chess using Whisper + WebAssembly
4+
5+
Online demo: https://whisper.ggerganov.com/wchess/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
add_library(wchess-core STATIC
2+
WChess.cpp
3+
WChess.h
4+
Chessboard.cpp
5+
Chessboard.h
6+
)
7+
8+
target_link_libraries(wchess-core
9+
PUBLIC
10+
whisper
11+
common
12+
)
13+
14+
target_include_directories(wchess-core
15+
PUBLIC
16+
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
17+
)
18+
19+
# add_executable(test-chessboard test-chessboard.cpp Chessboard.cpp)

0 commit comments

Comments
 (0)