#!/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\""