danbev commited on
Commit
4a1f367
Β·
unverified Β·
1 Parent(s): 6437539

examples : add note about WHISPER_WASM_SINGLE_FILE [no ci] (#3332)

Browse files

This commit adds a note to the README files of the WASM examples
about the `WHISPER_WASM_SINGLE_FILE` option.

The motivation for this is that currently this option is not documented
and might be surprising to users who expect a separate .wasm file to be
generated.

Refs: https://github.com/ggml-org/whisper.cpp/issues/3290

examples/bench.wasm/README.md CHANGED
@@ -32,6 +32,16 @@ cp bin/libbench.js /path/to/html/
32
  cp bin/libbench.worker.js /path/to/html/
33
  ```
34
 
 
 
 
 
 
 
 
 
 
 
35
  > πŸ“ **Note:** As of Emscripten 3.1.58 (April 2024), separate worker.js files are no
36
  > longer generated and the worker is embedded in the main JS file. So the worker
37
  > file will not be geneated for versions later than `3.1.58`.
 
32
  cp bin/libbench.worker.js /path/to/html/
33
  ```
34
 
35
+ > πŸ“ **Note:** By default this example is built with `WHISPER_WASM_SINGLE_FILE=ON`
36
+ > which means that that a separate .wasm file will not be generated. Instead, the
37
+ > WASM module is embedded in the main JS file as a base64 encoded string. To
38
+ > generate a separate .wasm file, you need to disable this option by passing
39
+ > `-DWHISPER_WASM_SINGLE_FILE=OFF`:
40
+ > ```console
41
+ > emcmake cmake .. -DWHISPER_WASM_SINGLE_FILE=OFF
42
+ > ```
43
+ > This will generate a `libbench.wasm` file in the build/bin directory.
44
+
45
  > πŸ“ **Note:** As of Emscripten 3.1.58 (April 2024), separate worker.js files are no
46
  > longer generated and the worker is embedded in the main JS file. So the worker
47
  > file will not be geneated for versions later than `3.1.58`.
examples/command.wasm/README.md CHANGED
@@ -32,6 +32,16 @@ cp bin/libcommand.js /path/to/html/
32
  cp bin/libcommand.worker.js /path/to/html/
33
  ```
34
 
 
 
 
 
 
 
 
 
 
 
35
  > πŸ“ **Note:** As of Emscripten 3.1.58 (April 2024), separate worker.js files are no
36
  > longer generated and the worker is embedded in the main JS file. So the worker
37
  > file will not be geneated for versions later than `3.1.58`.
 
32
  cp bin/libcommand.worker.js /path/to/html/
33
  ```
34
 
35
+ > πŸ“ **Note:** By default this example is built with `WHISPER_WASM_SINGLE_FILE=ON`
36
+ > which means that that a separate .wasm file will not be generated. Instead, the
37
+ > WASM module is embedded in the main JS file as a base64 encoded string. To
38
+ > generate a separate .wasm file, you need to disable this option by passing
39
+ > `-DWHISPER_WASM_SINGLE_FILE=OFF`:
40
+ > ```console
41
+ > emcmake cmake .. -DWHISPER_WASM_SINGLE_FILE=OFF
42
+ > ```
43
+ > This will generate a `libcommand.wasm` file in the build/bin directory.
44
+
45
  > πŸ“ **Note:** As of Emscripten 3.1.58 (April 2024), separate worker.js files are no
46
  > longer generated and the worker is embedded in the main JS file. So the worker
47
  > file will not be geneated for versions later than `3.1.58`.
examples/stream.wasm/README.md CHANGED
@@ -30,6 +30,16 @@ cp bin/libstream.js /path/to/html/
30
  cp bin/libstream.worker.js /path/to/html/
31
  ```
32
 
 
 
 
 
 
 
 
 
 
 
33
  > πŸ“ **Note:** As of Emscripten 3.1.58 (April 2024), separate worker.js files are no
34
  > longer generated and the worker is embedded in the main JS file. So the worker
35
  > file will not be geneated for versions later than `3.1.58`.
 
30
  cp bin/libstream.worker.js /path/to/html/
31
  ```
32
 
33
+ > πŸ“ **Note:** By default this example is built with `WHISPER_WASM_SINGLE_FILE=ON`
34
+ > which means that that a separate .wasm file will not be generated. Instead, the
35
+ > WASM module is embedded in the main JS file as a base64 encoded string. To
36
+ > generate a separate .wasm file, you need to disable this option by passing
37
+ > `-DWHISPER_WASM_SINGLE_FILE=OFF`:
38
+ > ```console
39
+ > emcmake cmake .. -DWHISPER_WASM_SINGLE_FILE=OFF
40
+ > ```
41
+ > This will generate a `libstream.wasm` file in the build/bin directory.
42
+
43
  > πŸ“ **Note:** As of Emscripten 3.1.58 (April 2024), separate worker.js files are no
44
  > longer generated and the worker is embedded in the main JS file. So the worker
45
  > file will not be geneated for versions later than `3.1.58`.
examples/whisper.wasm/README.md CHANGED
@@ -52,6 +52,16 @@ cp bin/libmain.js /path/to/html/
52
  cp bin/libmain.worker.js /path/to/html/
53
  ```
54
 
 
 
 
 
 
 
 
 
 
 
55
  > πŸ“ **Note:** As of Emscripten 3.1.58 (April 2024), separate worker.js files are no
56
  > longer generated and the worker is embedded in the main JS file. So the worker
57
  > file will not be geneated for versions later than `3.1.58`.
 
52
  cp bin/libmain.worker.js /path/to/html/
53
  ```
54
 
55
+ > πŸ“ **Note:** By default this example is built with `WHISPER_WASM_SINGLE_FILE=ON`
56
+ > which means that that a separate .wasm file will not be generated. Instead, the
57
+ > WASM module is embedded in the main JS file as a base64 encoded string. To
58
+ > generate a separate .wasm file, you need to disable this option by passing
59
+ > `-DWHISPER_WASM_SINGLE_FILE=OFF`:
60
+ > ```console
61
+ > emcmake cmake .. -DWHISPER_WASM_SINGLE_FILE=OFF
62
+ > ```
63
+ > This will generate a `libmain.wasm` file in the build/bin directory.
64
+
65
  > πŸ“ **Note:** As of Emscripten 3.1.58 (April 2024), separate worker.js files are no
66
  > longer generated and the worker is embedded in the main JS file. So the worker
67
  > file will not be geneated for versions later than `3.1.58`.