Skip to content

Commit

Permalink
Merge pull request #10 from AuYang261/master
Browse files Browse the repository at this point in the history
update wamr doc
  • Loading branch information
coolyjg authored Mar 22, 2024
2 parents 263eca1 + 2b3bc1b commit 4d20282
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/chap02/apps/wamr.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,9 @@ cp test_tensorflow.wasm ../../../../../../rootfs/
`*.tflite`模型文件由`rootfs/models/*.py`生成,可以在本地使用python生成自定义的`*.tflite`模型文件。

运行上述`make`命令体验在RuxOS上运行神经网络模型。

如果你想在Rust中构建支持wasi_nn的wasm,需要在make命令中添加`WAMR_BUILD_WASI_EPHEMERAL_NN=1`参数。因为Rust中wasi_nn的模块名是`wasi_ephemeral_nn`,而不是`wasi_nn`

```bash
make A=apps/c/wamr ARCH=aarch64 LOG=info run MUSL=y NET=y V9P=y V9P_PATH=apps/c/wamr/rootfs ARGS="iwasm,--env="TARGET=cpu",--dir=.,/built_from_rust.wasm" WASI_NN=1 WAMR_BUILD_WASI_EPHEMERAL_NN=1
```
5 changes: 5 additions & 0 deletions translations/en/chap02/apps/wamr.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,8 @@ The `.tflite` model files are generated by `rootfs/models/*.py`. you can also ge

Then run the `make` command above to enjoy the NN support in ruxos.

If you want to run WASM built from rust with wasi_nn support, you will need to add `WAMR_BUILD_WASI_EPHEMERAL_NN=1` argument in the make command. Because the module name of wasi_nn in rust is `wasi_ephemeral_nn`, instead of `wasi_nn`:

```bash
make A=apps/c/wamr ARCH=aarch64 LOG=info run MUSL=y NET=y V9P=y V9P_PATH=apps/c/wamr/rootfs ARGS="iwasm,--env="TARGET=cpu",--dir=.,/built_from_rust.wasm" WASI_NN=1 WAMR_BUILD_WASI_EPHEMERAL_NN=1
```

0 comments on commit 4d20282

Please sign in to comment.