blob: fde74fe3cc9795b0bf7318f8a5c60397c3ee1469 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/usr/bin/env bash
# Fetches everything the Whistle evaluation harness needs and rebuilds the
# ONNX external-data files from the small whistle.pack.
set -euo pipefail
cd "$(dirname "$0")"
WHISTLE_BASE="https://huggingface.co/mrfakename/whistle-ONNX/resolve/main"
WHISPER_BASE="https://huggingface.co/csukuangfj/sherpa-onnx-whisper"
mkdir -p vendor/js vendor/onnx models/tiny models/base
echo "==> Downloading the Whistle pack and ONNX graphs"
curl -L --fail -o vendor/whistle.pack "$WHISTLE_BASE/whistle.pack"
curl -L --fail -o vendor/onnx/encoder.onnx "$WHISTLE_BASE/onnx/encoder.onnx"
curl -L --fail -o vendor/onnx/decoder.onnx "$WHISTLE_BASE/onnx/decoder.onnx"
echo "==> Downloading the reference JS pipeline"
for file in pack.js whistle.js backend.js example.mjs; do
curl -L --fail -o "vendor/js/$file" "$WHISTLE_BASE/js/$file"
done
echo "==> Installing onnxruntime-node"
npm install --no-audit --no-fund
echo "==> Rebuilding fp32 ONNX data from whistle.pack"
node build-data.mjs
echo "==> Downloading Whisper tiny/base int8 (sherpa-onnx)"
for model in tiny base; do
for file in encoder.int8.onnx decoder.int8.onnx tokens.txt; do
curl -L --fail -o "models/$model/$file" "$WHISPER_BASE-$model/resolve/main/$model-$file"
done
done
echo
echo "Done. Next:"
echo " python3 -m venv .venv && .venv/bin/pip install sherpa-onnx numpy"
echo " .venv/bin/python evaluate.py \"samples/*.wav\""
|