File size: 367 Bytes
a23854b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# english_patch.py
import melo.text.english as eng
orig_g2p = eng.g2p
def patched_g2p(text):
phones, tones, word2ph = orig_g2p(text)
fixed_word2ph = []
for aaa in word2ph:
if isinstance(aaa, int):
fixed_word2ph.append(aaa)
else:
fixed_word2ph += aaa
return phones, tones, fixed_word2ph
eng.g2p = patched_g2p
|