[Examples] Add the named model feature into pytorch demo. #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test TFlite examples | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'info' | |
push: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install apt-get packages | |
run: | | |
sudo ACCEPT_EULA=Y apt-get update | |
sudo ACCEPT_EULA=Y apt-get upgrade | |
sudo apt-get install wget git curl software-properties-common build-essential | |
- name: Install Rust target for wasm | |
run: | | |
rustup target add wasm32-wasi | |
- name: Install WasmEdge + WASI-NN + TFLite | |
run: | | |
VERSION=0.13.2 | |
TFVERSION=2.12.0 | |
curl -s -L -O --remote-name-all https://github.com/second-state/WasmEdge-tensorflow-deps/releases/download/TF-2.12.0-CC/WasmEdge-tensorflow-deps-TFLite-TF-$TFVERSION-CC-manylinux2014_x86_64.tar.gz | |
tar -zxf WasmEdge-tensorflow-deps-TFLite-TF-$TFVERSION-CC-manylinux2014_x86_64.tar.gz | |
rm -f WasmEdge-tensorflow-deps-TFLite-TF-$TFVERSION-CC-manylinux2014_x86_64.tar.gz | |
sudo mv libtensorflowlite_c.so /usr/local/lib | |
sudo mv libtensorflowlite_flex.so /usr/local/lib | |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -v $VERSION --plugins wasi_nn-tensorflowlite -p /usr/local | |
- name: Example | |
run: | | |
cd tflite-birds_v1-image/rust | |
cargo build --target wasm32-wasi --release | |
cd .. | |
wasmedge compile rust/target/wasm32-wasi/release/wasmedge-wasinn-example-tflite-bird-image.wasm wasmedge-wasinn-example-tflite-bird-image.wasm | |
wasmedge --dir .:. wasmedge-wasinn-example-tflite-bird-image.wasm lite-model_aiy_vision_classifier_birds_V1_3.tflite bird.jpg | |