Fangjun Kuang
Committed by GitHub

Avoid appending blanks for Cantonese vits tts. (#2559)

@@ -190,11 +190,6 @@ std::vector<TokenIDs> Lexicon::ConvertTextToTokenIdsChinese( @@ -190,11 +190,6 @@ std::vector<TokenIDs> Lexicon::ConvertTextToTokenIdsChinese(
190 std::vector<TokenIDs> ans; 190 std::vector<TokenIDs> ans;
191 std::vector<int64_t> this_sentence; 191 std::vector<int64_t> this_sentence;
192 192
193 - int32_t blank = -1;  
194 - if (token2id_.count(" ")) {  
195 - blank = token2id_.at(" ");  
196 - }  
197 -  
198 int32_t sil = -1; 193 int32_t sil = -1;
199 int32_t eos = -1; 194 int32_t eos = -1;
200 if (token2id_.count("sil")) { 195 if (token2id_.count("sil")) {
@@ -249,9 +244,6 @@ std::vector<TokenIDs> Lexicon::ConvertTextToTokenIdsChinese( @@ -249,9 +244,6 @@ std::vector<TokenIDs> Lexicon::ConvertTextToTokenIdsChinese(
249 const auto &token_ids = word2ids_.at(w); 244 const auto &token_ids = word2ids_.at(w);
250 this_sentence.insert(this_sentence.end(), token_ids.begin(), 245 this_sentence.insert(this_sentence.end(), token_ids.begin(),
251 token_ids.end()); 246 token_ids.end());
252 - if (blank != -1) {  
253 - this_sentence.push_back(blank);  
254 - }  
255 } 247 }
256 248
257 if (sil != -1) { 249 if (sil != -1) {