fix(api): handle missing attribute in is_multilingual

This commit is contained in:
Enno Hermann 2023-12-20 15:18:01 +01:00
parent 55c7063724
commit 91087205d2
1 changed files with 2 additions and 4 deletions

View File

@ -99,7 +99,7 @@ class TTS(nn.Module):
isinstance(self.model_name, str)
and "xtts" in self.model_name
or self.config
and ("xtts" in self.config.model or len(self.config.languages) > 1)
and ("xtts" in self.config.model or "languages" in self.config and len(self.config.languages) > 1)
):
return True
if hasattr(self.synthesizer.tts_model, "language_manager") and self.synthesizer.tts_model.language_manager:
@ -168,9 +168,7 @@ class TTS(nn.Module):
self.synthesizer = None
self.model_name = model_name
model_path, config_path, vocoder_path, vocoder_config_path, model_dir = self.download_model_by_name(
model_name
)
model_path, config_path, vocoder_path, vocoder_config_path, model_dir = self.download_model_by_name(model_name)
# init synthesizer
# None values are fetch from the model