From: Georgi Gerganov Date: Wed, 24 May 2023 08:49:53 +0000 (+0300) Subject: mnist : add WASM instructions + web-page link X-Git-Tag: upstream/0.0.1642~1440 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=2992df03010bb6afe399f13378f20ed45b0758c8;p=pkg%2Fggml%2Fsources%2Fggml mnist : add WASM instructions + web-page link --- diff --git a/examples/mnist/README.md b/examples/mnist/README.md index bb088884..0f2ed8c2 100644 --- a/examples/mnist/README.md +++ b/examples/mnist/README.md @@ -90,3 +90,15 @@ Predicted digit is 9 Computation graph: ![mnist dot](https://user-images.githubusercontent.com/1991296/231882071-84e29d53-b226-4d73-bdc2-5bd6dcb7efd1.png) + + +## Web demo + +The example can be compiled with Emscripten like this: + +```bash +cd examples/mnist +emcc -I../../include -I../../include/ggml -I../../examples ../../src/ggml.c main.cpp -o web/mnist.js -s EXPORTED_FUNCTIONS='["_wasm_eval","_wasm_random_digit","_malloc","_free"]' -s EXPORTED_RUNTIME_METHODS='["ccall"]' -s ALLOW_MEMORY_GROWTH=1 --preload-file models/mnist +``` + +Online demo: https://mnist.ggerganov.com