When I test MeloTTS for Korean
MeloTTS use g2pkk for Korean and When I use Ubuntu it works fine but Mac M1 had trouble on here.
|
def annotate(string, mecab): |
|
tokens = mecab.pos(string) |
|
if string.replace(" ", "") != "".join(token for token, _ in tokens): |
AttributeError: 'NoneType' object has no attribute 'pos'
Debugging shows `mecab' return None on here
|
def get_mecab(self): |
|
if platform.system() == 'Windows': |
|
try: |
|
m = self.load_module_func('eunjeon') |
|
return m.Mecab() |
|
except Exception as e: |
|
raise print(f'you have to install eunjeon. "pip install eunjeon"') |
|
else: |
|
try: |
|
m = self.load_module_func('mecab') |
|
return m.MeCab() |
|
except Exception as e: |
|
print(f'you have to install python-mecab-ko. "pip install python-mecab-ko"') |
Difference of Ubuntu and M1 is mecab module existance. Ubuntu has but not M1.
I think pip install mecab-python3 make a little different in each OS.
So when I changed here
m = self.load_module_func('mecab')
return m.MeCab()
def annotate(string, mecab):
tokens = mecab.pos(string)
if string.replace(" ", "") != "".join(token for token, _ in tokens):
to
import MeCab
return MeCab.Tagger()
tokens = mecab.parse(string)
if string.replace(" ", "") != "".join(token for token in tokens):
It works.
So I think it might need to check self.load_module_func('mecab') is None or not
When I test MeloTTS for
KoreanMeloTTS use
g2pkkforKoreanand When I useUbuntuit works fine butMac M1had trouble on here.g2pkk/g2pkk/utils.py
Lines 165 to 167 in adec977
Debugging shows `mecab' return None on here
g2pkk/g2pkk/g2pkk.py
Lines 56 to 68 in adec977
Difference of
UbuntuandM1ismecabmodule existance.Ubuntuhas but notM1.So when I changed here
to
It works.
So I think it might need to check
self.load_module_func('mecab')is None or not