ahadjawaid
Committed by GitHub

Fix: Prepend 0 to tokenization to prevent word skipping for Kokoro. (#1787)

Addressed issue Skipping words #1777
@@ -163,6 +163,8 @@ static std::vector<std::vector<int64_t>> PiperPhonemesToIdsKokoro( @@ -163,6 +163,8 @@ static std::vector<std::vector<int64_t>> PiperPhonemesToIdsKokoro(
163 std::vector<int64_t> current; 163 std::vector<int64_t> current;
164 current.reserve(phonemes.size()); 164 current.reserve(phonemes.size());
165 165
  166 + current.push_back(0);
  167 +
166 for (auto p : phonemes) { 168 for (auto p : phonemes) {
167 if (token2id.count(p)) { 169 if (token2id.count(p)) {
168 if (current.size() > max_len - 1) { 170 if (current.size() > max_len - 1) {