Skip to content
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

Closed
wants to merge 13 commits into from
Closed

Load the japanese phonemizer only if there's an environment variable set #2826

wants to merge 13 commits into from

Conversation

hathibelagal-dev
Copy link

After installing TTS using the following command

pip install TTS

this fails

from TTS.api import TTS

with the following error:
Screenshot 2023-07-31 at 21-35-09 Google Colaboratory

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.

The environment variable ENABLE_JAPANESE should exist for the ja_jp_phonemizer to be available
@CLAassistant
Copy link

CLAassistant commented Jul 31, 2023

CLA assistant check
All committers have signed the CLA.

@@ -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:
Copy link
Member

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]

@erogol
Copy link
Member

erogol commented Aug 7, 2023

Fixed the problem here #2843

Closing it for now.

@erogol erogol closed this Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants