From 3ebc28608c3cecc170d8899c71de59ad00206c4a Mon Sep 17 00:00:00 2001 From: bivashy Date: Sat, 6 Jan 2024 13:40:35 +0600 Subject: [PATCH] Multi speaker and language support --- TTS/server/server.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TTS/server/server.py b/TTS/server/server.py index 6b2141a9aa..66b7dcb280 100644 --- a/TTS/server/server.py +++ b/TTS/server/server.py @@ -113,15 +113,15 @@ def convert_boolean(x): use_cuda=args.use_cuda, ) -use_multi_speaker = hasattr(synthesizer.tts_model, "num_speakers") and ( - synthesizer.tts_model.num_speakers > 1 or synthesizer.tts_speakers_file is not None -) speaker_manager = getattr(synthesizer.tts_model, "speaker_manager", None) +use_multi_speaker = (hasattr(synthesizer.tts_model, "num_speakers") and ( + synthesizer.tts_model.num_speakers > 1 or synthesizer.tts_speakers_file is not None +)) or (speaker_manager is not None) -use_multi_language = hasattr(synthesizer.tts_model, "num_languages") and ( - synthesizer.tts_model.num_languages > 1 or synthesizer.tts_languages_file is not None -) language_manager = getattr(synthesizer.tts_model, "language_manager", None) +use_multi_language = (hasattr(synthesizer.tts_model, "num_languages") and ( + synthesizer.tts_model.num_languages > 1 or synthesizer.tts_languages_file is not None +)) or (language_manager is not None) # TODO: set this from SpeakerManager use_gst = synthesizer.tts_config.get("use_gst", False)