Skip to content

Commit

Permalink
Update server.py
Browse files Browse the repository at this point in the history
Try to support the XTTS-v2 in multilingul cases, because XTTS-v2 models may not has the num_speakers and num_languages variables.
  • Loading branch information
SunAriesCN authored Dec 19, 2023
1 parent 55c7063 commit 6b5cdd9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions TTS/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,16 @@ def convert_boolean(x):
use_cuda=args.use_cuda,
)

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
)
speaker_manager = getattr(synthesizer.tts_model, "speaker_manager", None)
) or (speaker_manager 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
)
language_manager = getattr(synthesizer.tts_model, "language_manager", None)
) or (language_manager is not None)


# TODO: set this from SpeakerManager
use_gst = synthesizer.tts_config.get("use_gst", False)
Expand Down

0 comments on commit 6b5cdd9

Please sign in to comment.