voicefixer uses CUDA if exposed

This commit is contained in:
mrq 2023-02-13 15:30:49 +00:00
parent 8250a79b23
commit 47f4b5bf81

View File

@ -19,6 +19,7 @@ import tortoise.api
from tortoise.api import TextToSpeech from tortoise.api import TextToSpeech
from tortoise.utils.audio import load_audio, load_voice, load_voices, get_voice_dir from tortoise.utils.audio import load_audio, load_voice, load_voices, get_voice_dir
from tortoise.utils.text import split_and_recombine_text from tortoise.utils.text import split_and_recombine_text
from tortoise.utils.device import get_device_name
voicefixer = None voicefixer = None
@ -271,7 +272,7 @@ def generate(
voicefixer.restore( voicefixer.restore(
input=path, input=path,
output=path, output=path,
#cuda=False, cuda=get_device_name() == "cuda",
#mode=mode, #mode=mode,
) )
@ -295,7 +296,7 @@ def generate(
info['seed'] = settings['use_deterministic_seed'] info['seed'] = settings['use_deterministic_seed']
if 'latents' in info: if 'latents' in info:
del info['latents'] del info['latents']
with open(f'./config/generate.json', 'w', encoding="utf-8") as f: with open(f'./config/generate.json', 'w', encoding="utf-8") as f:
f.write(json.dumps(info, indent='\t') ) f.write(json.dumps(info, indent='\t') )