Skip to content

Commit ec54bb3

Browse files
grorge123hydai
authored andcommitted
[Example] ChatTTS: add CI test
1 parent a7a5d3d commit ec54bb3

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/chatTTS.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ChatTTS example
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
push:
7+
paths:
8+
- ".github/workflows/chatTTS.yml"
9+
- "wasmedge-chatTTS/**"
10+
pull_request:
11+
paths:
12+
- ".github/workflows/chatTTS.yml"
13+
- "wasmedge-chatTTS/**"
14+
jobs:
15+
build:
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- name: Install Dependencies for building WasmEdge
19+
run: |
20+
sudo apt-get -y update
21+
sudo apt-get -y install wget git curl software-properties-common build-essential python3 python3-dev python3-pip ninja-build
22+
pip install chattts==0.1.1
23+
24+
- name: Install Rust target for wasm
25+
run: |
26+
rustup target add wasm32-wasi
27+
28+
- name: Checkout WasmEdge
29+
uses: actions/checkout@v4
30+
with:
31+
repository: WasmEdge/WasmEdge
32+
path: WasmEdge
33+
- name: Build WasmEdge with WASI-NN ChatTTS plugin
34+
run: |
35+
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_USE_LLVM=OFF -DWASMEDGE_PLUGIN_WASI_NN_BACKEND=ChatTTS
36+
cmake --build build
37+
working-directory: WasmEdge
38+
39+
- name: Checkout WasmEdge-WASINN-examples
40+
uses: actions/checkout@v4
41+
with:
42+
path: WasmEdge-WASINN-examples
43+
44+
- name: Build wasm
45+
run: cargo build --target wasm32-wasi --release
46+
working-directory: WasmEdge-WASINN-examples/wasmedge-chatTTS
47+
48+
- name: Execute
49+
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
50+
51+
- name: Verify output
52+
run: test "$(file --brief output1.wav)" == 'RIFF (little-endian) data, WAVE audio, mono 24000 Hz'
53+

wasmedge-chatTTS/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ edition = "2021"
55

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

0 commit comments

Comments
 (0)