Add address sanitizer and undefined behavior sanitizer (#951)

This commit is contained in:
Fangjun Kuang
2024-05-31 13:17:01 +08:00
committed by GitHub
parent a38881817c
commit f1cff83ef9
56 changed files with 354 additions and 132 deletions

View File

@@ -96,7 +96,7 @@ OfflineTtsCharacterFrontend::OfflineTtsCharacterFrontend(
std::vector<std::vector<int64_t>>
OfflineTtsCharacterFrontend::ConvertTextToTokenIds(
const std::string &_text, const std::string &voice /*= ""*/) const {
const std::string &_text, const std::string & /*voice = ""*/) const {
// see
// https://github.com/coqui-ai/TTS/blob/dev/TTS/tts/utils/text/tokenizer.py#L87
int32_t use_eos_bos = meta_data_.use_eos_bos;
@@ -151,7 +151,7 @@ OfflineTtsCharacterFrontend::ConvertTextToTokenIds(
this_sentence.push_back(eos_id);
}
if (this_sentence.size() > 1 + use_eos_bos) {
if (static_cast<int32_t>(this_sentence.size()) > 1 + use_eos_bos) {
ans.push_back(std::move(this_sentence));
}
} else {