Skip to content

Commit

Permalink
Fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Jan 2, 2025
1 parent 84c844c commit c0e4830
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
17 changes: 8 additions & 9 deletions .github/scripts/test-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions sherpa-onnx/csrc/piper-phonemize-lexicon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@
namespace sherpa_onnx {

static void CallPhonemizeEspeak(
const std::string &text, piper::eSpeakPhonemeConfig &config,
std::vector<std::vector<piper::Phoneme>> &phonemes) {
const std::string &text,
piper::eSpeakPhonemeConfig &config, // NOLINT
std::vector<std::vector<piper::Phoneme>> *phonemes) {
static std::mutex espeak_mutex;

std::lock_guard<std::mutex> 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<char32_t, int32_t> ReadTokens(std::istream &is) {
Expand Down Expand Up @@ -304,7 +305,7 @@ std::vector<TokenIDs> PiperPhonemizeLexicon::ConvertTextToTokenIdsMatcha(

std::vector<std::vector<piper::Phoneme>> phonemes;

CallPhonemizeEspeak(text, config, phonemes);
CallPhonemizeEspeak(text, config, &phonemes);

std::vector<TokenIDs> ans;

Expand All @@ -329,7 +330,7 @@ std::vector<TokenIDs> PiperPhonemizeLexicon::ConvertTextToTokenIdsVits(

std::vector<std::vector<piper::Phoneme>> phonemes;

CallPhonemizeEspeak(text, config, phonemes);
CallPhonemizeEspeak(text, config, &phonemes);

std::vector<TokenIDs> ans;

Expand Down

0 comments on commit c0e4830

Please sign in to comment.