]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
mnist : fix the emcc command to compile correctly (#746)
authorOndřej Čertík <redacted>
Sun, 25 Feb 2024 13:57:04 +0000 (06:57 -0700)
committerGitHub <redacted>
Sun, 25 Feb 2024 13:57:04 +0000 (15:57 +0200)
Otherwise we get linking errors:

wasm-ld: error: /var/folders/8w/5mqfkhqn1nj0tw97g3hl1nyh0000gn/T/emscripten_temp_hj657tq4/ggml_0.o: undefined symbol: dequantize_row_q4_0
wasm-ld: error: /var/folders/8w/5mqfkhqn1nj0tw97g3hl1nyh0000gn/T/emscripten_temp_hj657tq4/ggml_0.o: undefined symbol: quantize_row_q4_0
...

examples/mnist/README.md

index 32e949d4151050b212478a6759a2a361d1c3aaad..cf3f8d0d06d69c05a25fdd4ac21caae27c3f0e7d 100644 (file)
@@ -127,7 +127,7 @@ 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
+emcc -I../../include -I../../include/ggml -I../../examples ../../src/ggml.c ../../src/ggml-quants.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