Add support for the new NeMo Canary ASR model across multiple language bindings by introducing a Canary model configuration and setter method on the offline recognizer. - Define Canary model config in Pascal, Go, C#, Dart and update converter functions - Add SetConfig API for offline recognizer (Pascal, Go, C#, Dart) - Extend CI/workflows and example scripts to test non-streaming Canary decoding
43 lines
1.4 KiB
Bash
Executable File
43 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
SHERPA_ONNX_DIR=$(cd $SCRIPT_DIR/../.. && pwd)
|
|
|
|
echo "SHERPA_ONNX_DIR: $SHERPA_ONNX_DIR"
|
|
|
|
if [[ ! -f ../../build/install/lib/libsherpa-onnx-c-api.dylib && ! -f ../../build/install/lib/libsherpa-onnx-c-api.so && ! -f ../../build/install/lib/sherpa-onnx-c-api.dll ]]; then
|
|
mkdir -p ../../build
|
|
pushd ../../build
|
|
cmake \
|
|
-DCMAKE_INSTALL_PREFIX=./install \
|
|
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
|
|
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
|
|
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
|
|
-DBUILD_SHARED_LIBS=ON \
|
|
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
|
|
..
|
|
|
|
cmake --build . --target install --config Release
|
|
ls -lh lib
|
|
popd
|
|
fi
|
|
|
|
if [ ! -f sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8/encoder.int8.onnx ]; then
|
|
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8.tar.bz2
|
|
tar xvf sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8.tar.bz2
|
|
rm sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8.tar.bz2
|
|
fi
|
|
|
|
fpc \
|
|
-dSHERPA_ONNX_USE_SHARED_LIBS \
|
|
-Fu$SHERPA_ONNX_DIR/sherpa-onnx/pascal-api \
|
|
-Fl$SHERPA_ONNX_DIR/build/install/lib \
|
|
./nemo_canary.pas
|
|
|
|
export LD_LIBRARY_PATH=$SHERPA_ONNX_DIR/build/install/lib:$LD_LIBRARY_PATH
|
|
export DYLD_LIBRARY_PATH=$SHERPA_ONNX_DIR/build/install/lib:$DYLD_LIBRARY_PATH
|
|
|
|
./nemo_canary
|