Fix a bug in g2pW

pull/2230/head
BarryKCL 2 years ago
parent aecf8fd384
commit 5e63ac1e60

@ -40,3 +40,6 @@ We borrowed a lot of code from these repos to build `model` and `engine`, thanks
* [ThreadPool](https://github.com/progschj/ThreadPool/blob/master/COPYING)
- zlib License
- ThreadPool
* [g2pW](https://github.com/GitYCC/g2pW/blob/master/LICENCE)
- Apache-2.0 license

@ -102,6 +102,9 @@ class G2PWOnnxConverter:
sentences = translated_sentences
texts, query_ids, sent_ids, partial_results = self._prepare_data(sentences)
if len(texts) == 0:
# sentences no polyphonic words
return partial_results
onnx_input = prepare_onnx_input(self.tokenizer, self.labels, self.char2phonemes, self.chars, texts, query_ids,
use_mask=self.config.use_mask, use_char_phoneme=self.config.use_char_phoneme,

Loading…
Cancel
Save