From 21a742cb5591960fd7e3bfb8b1933374ea71a204 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Sat, 7 Oct 2023 19:01:31 +0800 Subject: [PATCH 1/2] Fix building MFC --- .github/workflows/test-python-online-websocket-server.yaml | 2 +- .../NonStreamingSpeechRecognition/sherpa-onnx-deps.props | 3 +++ mfc-examples/StreamingSpeechRecognition/sherpa-onnx-deps.props | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-python-online-websocket-server.yaml b/.github/workflows/test-python-online-websocket-server.yaml index 15f81778e..428440edc 100644 --- a/.github/workflows/test-python-online-websocket-server.yaml +++ b/.github/workflows/test-python-online-websocket-server.yaml @@ -18,7 +18,7 @@ permissions: jobs: python_online_websocket_server: runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} ${{ matrix.python-version }} + name: ${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.model_type }} strategy: fail-fast: false matrix: diff --git a/mfc-examples/NonStreamingSpeechRecognition/sherpa-onnx-deps.props b/mfc-examples/NonStreamingSpeechRecognition/sherpa-onnx-deps.props index f0e609d3c..4c144708a 100644 --- a/mfc-examples/NonStreamingSpeechRecognition/sherpa-onnx-deps.props +++ b/mfc-examples/NonStreamingSpeechRecognition/sherpa-onnx-deps.props @@ -9,6 +9,9 @@ sherpa-onnx-portaudio_static.lib; sherpa-onnx-c-api.lib; sherpa-onnx-core.lib; + kaldi-decoder-core.lib; + sherpa-onnx-kaldifst-core.lib; + sherpa-onnx-fst.lib; kaldi-native-fbank-core.lib; absl_base.lib; absl_city.lib; diff --git a/mfc-examples/StreamingSpeechRecognition/sherpa-onnx-deps.props b/mfc-examples/StreamingSpeechRecognition/sherpa-onnx-deps.props index f0e609d3c..4c144708a 100644 --- a/mfc-examples/StreamingSpeechRecognition/sherpa-onnx-deps.props +++ b/mfc-examples/StreamingSpeechRecognition/sherpa-onnx-deps.props @@ -9,6 +9,9 @@ sherpa-onnx-portaudio_static.lib; sherpa-onnx-c-api.lib; sherpa-onnx-core.lib; + kaldi-decoder-core.lib; + sherpa-onnx-kaldifst-core.lib; + sherpa-onnx-fst.lib; kaldi-native-fbank-core.lib; absl_base.lib; absl_city.lib; From 8542c556099d126aad5774a95a325938028a313c Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Sat, 7 Oct 2023 20:23:41 +0800 Subject: [PATCH 2/2] Fix reading FST on windows --- sherpa-onnx/csrc/offline-ctc-fst-decoder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sherpa-onnx/csrc/offline-ctc-fst-decoder.cc b/sherpa-onnx/csrc/offline-ctc-fst-decoder.cc index a6f8e6318..31879e335 100644 --- a/sherpa-onnx/csrc/offline-ctc-fst-decoder.cc +++ b/sherpa-onnx/csrc/offline-ctc-fst-decoder.cc @@ -17,7 +17,7 @@ namespace sherpa_onnx { // this function is copied from kaldi static fst::Fst *ReadGraph(const std::string &filename) { // read decoding network FST - std::ifstream is(filename); + std::ifstream is(filename, std::ios::binary); if (!is.good()) { SHERPA_ONNX_LOGE("Could not open decoding-graph FST %s", filename.c_str()); }