0.9.0 + fix xtts not None
This commit is contained in:
parent
4d76aca1af
commit
a2a3d2b3eb
1 changed files with 3 additions and 2 deletions
|
|
@ -150,11 +150,12 @@ async def generate_speech(request: GenerateSpeechRequest):
|
||||||
if xtts is not None and xtts.model_name != tts_model:
|
if xtts is not None and xtts.model_name != tts_model:
|
||||||
import torch, gc
|
import torch, gc
|
||||||
del xtts
|
del xtts
|
||||||
|
xtts = None
|
||||||
gc.collect()
|
gc.collect()
|
||||||
torch.cuda.empty_cache()
|
torch.cuda.empty_cache()
|
||||||
|
|
||||||
if 'parler-tts' in tts_model and has_parler_tts:
|
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)
|
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))
|
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)
|
tts_io_out = xtts.tts(text=input_text, description=speaker)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if not xtts:
|
if xtts is None:
|
||||||
xtts = xtts_wrapper(tts_model, device=args.xtts_device)
|
xtts = xtts_wrapper(tts_model, device=args.xtts_device)
|
||||||
|
|
||||||
ffmpeg_args = build_ffmpeg_args(response_format, input_format="WAV", sample_rate="24000")
|
ffmpeg_args = build_ffmpeg_args(response_format, input_format="WAV", sample_rate="24000")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue