mirror of
https://github.com/k2-fsa/sherpa-onnx.git
synced 2026-11-10 21:11:03 +08:00
35 lines
973 B
Bash
Executable File
35 lines
973 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
if [ ! -d ../build-macos ]; then
|
|
echo "Please run ../build-macos.sh first!"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f ./sherpa-onnx-medasr-ctc-en-int8-2025-12-25/tokens.txt ]; then
|
|
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-medasr-ctc-en-int8-2025-12-25.tar.bz2
|
|
tar xvf sherpa-onnx-medasr-ctc-en-int8-2025-12-25.tar.bz2
|
|
rm sherpa-onnx-medasr-ctc-en-int8-2025-12-25.tar.bz2
|
|
fi
|
|
|
|
if [ ! -e ./medasr-ctc ]; then
|
|
# Note: We use -lc++ to link against libc++ instead of libstdc++
|
|
swiftc \
|
|
-lc++ \
|
|
-I ../build-macos/install/include \
|
|
-import-objc-header ./SherpaOnnx-Bridging-Header.h \
|
|
./medasr-ctc.swift ./SherpaOnnx.swift \
|
|
-L ../build-macos/install/lib/ \
|
|
-l sherpa-onnx-c-api \
|
|
-l onnxruntime \
|
|
-o medasr-ctc
|
|
|
|
strip medasr-ctc
|
|
else
|
|
echo "./medasr-ctc exists - skip building"
|
|
fi
|
|
|
|
export DYLD_LIBRARY_PATH=$PWD/../build-macos/install/lib:$DYLD_LIBRARY_PATH
|
|
./medasr-ctc
|