Skip to content

Commit

Permalink
Fix: Prepend 0 to tokenization to prevent word skipping for Kokoro. (#…
Browse files Browse the repository at this point in the history
…1787)

Addressed issue Skipping words #1777
  • Loading branch information
ahadjawaid authored Feb 3, 2025
1 parent 1d950a8 commit 8677d83
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sherpa-onnx/csrc/piper-phonemize-lexicon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ static std::vector<std::vector<int64_t>> PiperPhonemesToIdsKokoro(
std::vector<int64_t> current;
current.reserve(phonemes.size());

current.push_back(0);

for (auto p : phonemes) {
if (token2id.count(p)) {
if (current.size() > max_len - 1) {
Expand Down

0 comments on commit 8677d83

Please sign in to comment.