From a2a3d2b3ebde31345a87aa52ae9cfad4c37ca757 Mon Sep 17 00:00:00 2001 From: matatonic Date: Tue, 23 Apr 2024 22:35:03 -0400 Subject: [PATCH] 0.9.0 + fix xtts not None --- speech.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/speech.py b/speech.py index 5096da2..23b02b9 100755 --- a/speech.py +++ b/speech.py @@ -150,11 +150,12 @@ async def generate_speech(request: GenerateSpeechRequest): if xtts is not None and xtts.model_name != tts_model: import torch, gc del xtts + xtts = None gc.collect() torch.cuda.empty_cache() if 'parler-tts' in tts_model and has_parler_tts: - if not xtts: + if xtts is None: xtts = parler_tts(tts_model, device=args.xtts_device) ffmpeg_args = build_ffmpeg_args(response_format, input_format="WAV", sample_rate=str(xtts.model.config.sampling_rate)) @@ -165,7 +166,7 @@ async def generate_speech(request: GenerateSpeechRequest): tts_io_out = xtts.tts(text=input_text, description=speaker) else: - if not xtts: + if xtts is None: xtts = xtts_wrapper(tts_model, device=args.xtts_device) ffmpeg_args = build_ffmpeg_args(response_format, input_format="WAV", sample_rate="24000")