-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load the japanese phonemizer only if there's an environment variable set #2826
Load the japanese phonemizer only if there's an environment variable set #2826
Conversation
The environment variable ENABLE_JAPANESE should exist for the ja_jp_phonemizer to be available
Bug fix
Fix mecab dependency
Update GitHub actions
@@ -2,11 +2,20 @@ | |||
from TTS.tts.utils.text.phonemizers.base import BasePhonemizer | |||
from TTS.tts.utils.text.phonemizers.espeak_wrapper import ESpeak | |||
from TTS.tts.utils.text.phonemizers.gruut_wrapper import Gruut | |||
from TTS.tts.utils.text.phonemizers.ja_jp_phonemizer import JA_JP_Phonemizer | |||
import os | |||
if "ENABLE_JAPANESE" in os.environ: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can easily try-catch the import and show a warning if the user wants to use JA but it is not installed. ENV variable is not necessary as we already expect you to show your intentions when you install TTS with pip install TTS[ja]
Fixed the problem here #2843 Closing it for now. |
After installing TTS using the following command
this fails
with the following error:
This fix expects the user to set an environment value to work with Japanese. The environment variable ENABLE_JAPANESE should exist for the ja_jp_phonemizer to be available.