Committed by
GitHub
Fix: Prepend 0 to tokenization to prevent word skipping for Kokoro. (#1787)
Addressed issue Skipping words #1777
正在显示
1 个修改的文件
包含
2 行增加
和
0 行删除
| @@ -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) { |
-
请 注册 或 登录 后发表评论