Skip to content

second-state/WasmEdge-WASINN-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WasmEdge WASI-NN Examples

High-level bindings for writing wasi-nn applications

CI status - llama CI status - pytorch CI status - tflite

Introduction

This project provides the examples of high-level wasi-nn bindings and WasmEdge-TensorFlow plug-ins on Rust programming language. Developers can refer to this project to write their machine learning application in a high-level language using the bindings, compile it to WebAssembly, and run it with a WebAssembly runtime that supports the wasi-nn proposal, such as WasmEdge.

Prerequisites

OpenVINO Installation

Developers should install the OpenVINO first before build and run WasmEdge with wasi-nn and the examples. For this project, we use the version 2023.0.0. Please refer to WasmEdge Docs and OpenVINO™(2023)

wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/openvino/2023 ubuntu20 main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2023.list
sudo apt update
sudo apt-get -y install openvino
ldconfig

Rust Installation

For building the WASM files from rust source, please refer to the Rust Official Site for the Rust installation. After the installation, developers should add the wasm32-wasi target.

rustup target add wasm32-wasi

Download the wasi-nn Rust Crate

In Rust, download the crate from crates.io by adding wasi-nn = "0.4.0" as a Cargo dependency.

For using WasmEdge-TensorFlow plug-ins, please download the crate from crates.io by adding wasmedge_tensorflow_interface = "0.3.0" as a Cargo dependency.

WasmEdge Installation

You can refer to here to install WasmEdge.

For the examples with different wasi-nn backends or using the WasmEdge-Tensorflow plug-ins, please install with plug-ins and their dependencies:

Examples

Mobilenet

Related Links

License

This project is licensed under the Apache 2.0 license. See LICENSE for more details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published