danbev commited on
Commit
937218a
·
unverified ·
1 Parent(s): 0db3249

examples : update wasm examples to include server.py [no ci] (#2908)

Browse files

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 6e8242f7fe166b7798bbf49b4c65aba8afe1e131
("examples : command.wasm updates (#2904)").

The motivation for this is consistency with the command.wasm example.

examples/bench.wasm/README.md CHANGED
@@ -15,7 +15,17 @@ cd whisper.cpp
15
  mkdir build-em && cd build-em
16
  emcmake cmake ..
17
  make -j
 
 
 
 
 
 
 
18
 
 
 
 
19
  # copy the produced page to your HTTP path
20
  cp bin/bench.wasm/* /path/to/html/
21
  cp bin/libbench.worker.js /path/to/html/
 
15
  mkdir build-em && cd build-em
16
  emcmake cmake ..
17
  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
25
 
26
+ To run the example in a different server, you need to copy the following files
27
+ to the server's HTTP path:
28
+ ```
29
  # copy the produced page to your HTTP path
30
  cp bin/bench.wasm/* /path/to/html/
31
  cp bin/libbench.worker.js /path/to/html/
examples/stream.wasm/README.md CHANGED
@@ -13,7 +13,17 @@ cd whisper.cpp
13
  mkdir build-em && cd build-em
14
  emcmake cmake ..
15
  make -j
 
 
 
 
 
 
 
16
 
 
 
 
17
  # copy the produced page to your HTTP path
18
  cp bin/stream.wasm/* /path/to/html/
19
  cp bin/libstream.worker.js /path/to/html/
 
13
  mkdir build-em && cd build-em
14
  emcmake cmake ..
15
  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
23
 
24
+ To run the example in a different server, you need to copy the following files
25
+ to the server's HTTP path:
26
+ ```
27
  # copy the produced page to your HTTP path
28
  cp bin/stream.wasm/* /path/to/html/
29
  cp bin/libstream.worker.js /path/to/html/
examples/whisper.wasm/README.md CHANGED
@@ -35,7 +35,17 @@ cd whisper.cpp
35
  mkdir build-em && cd build-em
36
  emcmake cmake ..
37
  make -j
 
 
 
 
 
 
 
38
 
 
 
 
39
  # copy the produced page to your HTTP path
40
  cp bin/whisper.wasm/* /path/to/html/
41
  cp bin/libmain.worker.js /path/to/html/
 
35
  mkdir build-em && cd build-em
36
  emcmake cmake ..
37
  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
45
 
46
+ To run the example in a different server, you need to copy the following files
47
+ to the server's HTTP path:
48
+ ```
49
  # copy the produced page to your HTTP path
50
  cp bin/whisper.wasm/* /path/to/html/
51
  cp bin/libmain.worker.js /path/to/html/