Skip to content

Commit e7d9d86

Browse files
authoredMar 20, 2025
examples : update wasm examples to include server.py [no ci] (#2908)
This commit updates the README files for the wasm examples to include instructions on how to run the examples using the provided server.py which was included in Commit 6e8242f ("examples : command.wasm updates (#2904)"). The motivation for this is consistency with the command.wasm example.
1 parent 6e8242f commit e7d9d86

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
 

‎examples/bench.wasm/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@ cd whisper.cpp
1515
mkdir build-em && cd build-em
1616
emcmake cmake ..
1717
make -j
18+
```
19+
The example can then be started by running a local HTTP server:
20+
```console
21+
python3 examples/server.py
22+
```
23+
And then opening a browser to the following URL:
24+
http://localhost:8000/bench.wasm
1825

26+
To run the example in a different server, you need to copy the following files
27+
to the server's HTTP path:
28+
```
1929
# copy the produced page to your HTTP path
2030
cp bin/bench.wasm/* /path/to/html/
2131
cp bin/libbench.worker.js /path/to/html/

‎examples/stream.wasm/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@ cd whisper.cpp
1313
mkdir build-em && cd build-em
1414
emcmake cmake ..
1515
make -j
16+
```
17+
The example can then be started by running a local HTTP server:
18+
```console
19+
python3 examples/server.py
20+
```
21+
And then opening a browser to the following URL:
22+
http://localhost:8000/stream.wasm
1623

24+
To run the example in a different server, you need to copy the following files
25+
to the server's HTTP path:
26+
```
1727
# copy the produced page to your HTTP path
1828
cp bin/stream.wasm/* /path/to/html/
1929
cp bin/libstream.worker.js /path/to/html/

‎examples/whisper.wasm/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ cd whisper.cpp
3535
mkdir build-em && cd build-em
3636
emcmake cmake ..
3737
make -j
38+
```
39+
The example can then be started by running a local HTTP server:
40+
```console
41+
python3 examples/server.py
42+
```
43+
And then opening a browser to the following URL:
44+
http://localhost:8000/whisper.wasm
3845

46+
To run the example in a different server, you need to copy the following files
47+
to the server's HTTP path:
48+
```
3949
# copy the produced page to your HTTP path
4050
cp bin/whisper.wasm/* /path/to/html/
4151
cp bin/libmain.worker.js /path/to/html/

0 commit comments

Comments
 (0)