Fangjun Kuang
Committed by GitHub

Fix kokoro tts for punctuations (#2522)

... ... @@ -274,6 +274,10 @@ class KokoroMultiLangLexicon::Impl {
std::vector<std::vector<int32_t>> ConvertNonChineseToTokenIDs(
const std::string &text, const std::string &voice) const {
if (IsPunctuation(text)) {
return {std::vector<int32_t>{0, token2id_.at(text), 0}};
}
if (!voice.empty()) {
return ConvertTextToTokenIDsWithEspeak(text, voice);
}
... ...
... ... @@ -5,6 +5,8 @@ Please download test files used in this script from
https://github.com/k2-fsa/sherpa-onnx/releases/tag/speaker-recongition-models
*/
import Foundation
func cosineSimilarity(_ a: [Float], _ b: [Float]) -> Float {
precondition(a.count == b.count, "Vectors must have the same length")
... ...