Skip to content

Commit

Permalink
[Example] ChatTTS: add CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
grorge123 authored and hydai committed Aug 9, 2024
1 parent a7a5d3d commit ec54bb3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/chatTTS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: ChatTTS example

on:
schedule:
- cron: "0 0 * * *"
push:
paths:
- ".github/workflows/chatTTS.yml"
- "wasmedge-chatTTS/**"
pull_request:
paths:
- ".github/workflows/chatTTS.yml"
- "wasmedge-chatTTS/**"
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Install Dependencies for building WasmEdge
run: |
sudo apt-get -y update
sudo apt-get -y install wget git curl software-properties-common build-essential python3 python3-dev python3-pip ninja-build
pip install chattts==0.1.1
- name: Install Rust target for wasm
run: |
rustup target add wasm32-wasi
- name: Checkout WasmEdge
uses: actions/checkout@v4
with:
repository: WasmEdge/WasmEdge
path: WasmEdge
- name: Build WasmEdge with WASI-NN ChatTTS plugin
run: |
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_USE_LLVM=OFF -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=ChatTTS
cmake --build build
working-directory: WasmEdge

- name: Checkout WasmEdge-WASINN-examples
uses: actions/checkout@v4
with:
path: WasmEdge-WASINN-examples

- name: Build wasm
run: cargo build --target wasm32-wasi --release
working-directory: WasmEdge-WASINN-examples/wasmedge-chatTTS

- name: Execute
run: WASMEDGE_PLUGIN_PATH=WasmEdge/build/plugins/wasi_nn WasmEdge/build/tools/wasmedge/wasmedge --dir .:. WasmEdge-WASINN-examples/wasmedge-chatTTS/target/wasm32-wasi/release/wasmedge-chattts.wasm

- name: Verify output
run: test "$(file --brief output1.wav)" == 'RIFF (little-endian) data, WAVE audio, mono 24000 Hz'

2 changes: 1 addition & 1 deletion wasmedge-chatTTS/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ edition = "2021"

[dependencies]
serde_json = "1.0"
wasmedge-wasi-nn = {path = "../../wasmedge-wasi-nn/rust", version = "0.8.0"}
wasmedge-wasi-nn = {git = "https://github.com/second-state/wasmedge-wasi-nn.git", branch = "ggml"}
hound = "3.4"

0 comments on commit ec54bb3

Please sign in to comment.