From 47f4b5bf814266563677cac8e836dd71be3abd70 Mon Sep 17 00:00:00 2001 From: mrq Date: Mon, 13 Feb 2023 15:30:49 +0000 Subject: [PATCH] voicefixer uses CUDA if exposed --- webui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webui.py b/webui.py index ffc74a4..5d09ace 100755 --- a/webui.py +++ b/webui.py @@ -19,6 +19,7 @@ import tortoise.api from tortoise.api import TextToSpeech 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.device import get_device_name voicefixer = None @@ -271,7 +272,7 @@ def generate( voicefixer.restore( input=path, output=path, - #cuda=False, + cuda=get_device_name() == "cuda", #mode=mode, ) @@ -295,7 +296,7 @@ def generate( info['seed'] = settings['use_deterministic_seed'] if 'latents' in info: del info['latents'] - + with open(f'./config/generate.json', 'w', encoding="utf-8") as f: f.write(json.dumps(info, indent='\t') )