From c0e4830cfaade3f25d896f7274a634216d91a5fc Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Thu, 2 Jan 2025 12:26:20 +0800 Subject: [PATCH] Fix style issues --- .github/scripts/test-python.sh | 17 ++++++++--------- sherpa-onnx/csrc/piper-phonemize-lexicon.cc | 11 ++++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/scripts/test-python.sh b/.github/scripts/test-python.sh index 5b7f61bdc..350d9c185 100755 --- a/.github/scripts/test-python.sh +++ b/.github/scripts/test-python.sh @@ -275,14 +275,6 @@ rm matcha-icefall-en_US-ljspeech.tar.bz2 curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx -log "matcha-baker-zh test" - -curl -O -SL https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2 -tar xvf matcha-icefall-zh-baker.tar.bz2 -rm matcha-icefall-zh-baker.tar.bz2 - -curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx - python3 ./python-api-examples/offline-tts.py \ --matcha-acoustic-model=./matcha-icefall-en_US-ljspeech/model-steps-3.onnx \ --matcha-vocoder=./hifigan_v2.onnx \ @@ -295,6 +287,14 @@ python3 ./python-api-examples/offline-tts.py \ rm hifigan_v2.onnx rm -rf matcha-icefall-en_US-ljspeech +log "matcha-baker-zh test" + +curl -O -SL https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2 +tar xvf matcha-icefall-zh-baker.tar.bz2 +rm matcha-icefall-zh-baker.tar.bz2 + +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx + python3 ./python-api-examples/offline-tts.py \ --matcha-acoustic-model=./matcha-icefall-zh-baker/model-steps-3.onnx \ --matcha-vocoder=./hifigan_v2.onnx \ @@ -308,7 +308,6 @@ python3 ./python-api-examples/offline-tts.py \ rm -rf matcha-icefall-zh-baker rm hifigan_v2.onnx - log "vits-ljs test" curl -LS -O https://huggingface.co/csukuangfj/vits-ljs/resolve/main/vits-ljs.onnx diff --git a/sherpa-onnx/csrc/piper-phonemize-lexicon.cc b/sherpa-onnx/csrc/piper-phonemize-lexicon.cc index f982058ae..9bc93ce98 100644 --- a/sherpa-onnx/csrc/piper-phonemize-lexicon.cc +++ b/sherpa-onnx/csrc/piper-phonemize-lexicon.cc @@ -33,14 +33,15 @@ namespace sherpa_onnx { static void CallPhonemizeEspeak( - const std::string &text, piper::eSpeakPhonemeConfig &config, - std::vector> &phonemes) { + const std::string &text, + piper::eSpeakPhonemeConfig &config, // NOLINT + std::vector> *phonemes) { static std::mutex espeak_mutex; std::lock_guard lock(espeak_mutex); // keep multi threads from calling into piper::phonemize_eSpeak - piper::phonemize_eSpeak(text, config, phonemes); + piper::phonemize_eSpeak(text, config, *phonemes); } static std::unordered_map ReadTokens(std::istream &is) { @@ -304,7 +305,7 @@ std::vector PiperPhonemizeLexicon::ConvertTextToTokenIdsMatcha( std::vector> phonemes; - CallPhonemizeEspeak(text, config, phonemes); + CallPhonemizeEspeak(text, config, &phonemes); std::vector ans; @@ -329,7 +330,7 @@ std::vector PiperPhonemizeLexicon::ConvertTextToTokenIdsVits( std::vector> phonemes; - CallPhonemizeEspeak(text, config, phonemes); + CallPhonemizeEspeak(text, config, &phonemes); std::vector ans;