You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Synthesis from monolingual local models fails because of missing config attribute.
To Reproduce
fromTTS.apiimportTTScloud=TTS(model_name="tts_models/de/thorsten/vits") # just to download the modelcloud.tts("test") # this works finefromTTS.utils.generic_utilsimportget_user_data_dirmodel=os.path.join(get_user_data_dir("tts"), "tts_models--de--thorsten--vits", "model_file.pth")
config=os.path.join(get_user_data_dir("tts"), "tts_models--de--thorsten--vits", "config.json")
local=TTS(model_path=model, config_path=config)
_=local.tts("test")
The last line results in the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../TTS/api.py", line 357, in tts
self._check_arguments(
File ".../TTS/api.py", line 253, in _check_arguments
if self.is_multi_lingual and language is None:
File ".../torch/nn/modules/module.py", line 1695, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'TTS' object has no attribute 'is_multi_lingual'
The error message is somewhat confusing because is_multi_lingual is defined, but one variable used in that property function is None in certain cases. More details: pytorch/pytorch#13981
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.
self.config.languages is calling in a circular fashion
so len(self.config.languages) > 1 on line 102 fails.
the method should be:
@property
def is_multi_lingual(self):
# Not sure what sets this to None, but applied a fix to prevent crashing.
if hasattr(self.synthesizer.tts_model, "language_manager") and self.synthesizer.tts_model.language_manager:
return self.synthesizer.tts_model.language_manager.num_languages > 1
if (
isinstance(self.model_name, str)
and "xtts" in self.model_name
or self.config
and "xtts" in self.config.model
):
return True
return False
Describe the bug
Synthesis from monolingual local models fails because of missing config attribute.
To Reproduce
The last line results in the following error:
Expected behavior
No response
Logs
No response
Environment
Additional context
The error message is somewhat confusing because
is_multi_lingual
is defined, but one variable used in that property function isNone
in certain cases. More details: pytorch/pytorch#13981The text was updated successfully, but these errors were encountered: