]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
mnist : add WASM instructions + web-page link
authorGeorgi Gerganov <redacted>
Wed, 24 May 2023 08:49:53 +0000 (11:49 +0300)
committerGeorgi Gerganov <redacted>
Wed, 24 May 2023 08:49:53 +0000 (11:49 +0300)
examples/mnist/README.md

index bb08888407fdf8eba9edda9ec580cbfd3586883b..0f2ed8c2e23b262ab6f49a02aeffd3cc95f9bf88 100644 (file)
@@ -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