From ccbf2e6affd76e1f2e3e06e9c7ac27cd81e8e0e8 Mon Sep 17 00:00:00 2001 From: mrq Date: Sun, 12 Mar 2023 17:51:52 +0000 Subject: [PATCH] blame https://git.ecker.tech/mrq/ai-voice-cloning/pulls/122 --- src/utils.py | 9 +-------- src/webui.py | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/utils.py b/src/utils.py index 1503afa..d3af4e4 100755 --- a/src/utils.py +++ b/src/utils.py @@ -35,7 +35,7 @@ from datetime import timedelta from tortoise.api import TextToSpeech, MODELS, get_model_path, pad_or_truncate from tortoise.utils.audio import load_audio, load_voice, load_voices, get_voice_dir, get_voices from tortoise.utils.text import split_and_recombine_text -from tortoise.utils.device import get_device_name, set_device_name, get_device_count, get_device_vram +from tortoise.utils.device import get_device_name, set_device_name, get_device_count, get_device_vram, do_gc MODELS['dvae.pth'] = "https://huggingface.co/jbetker/tortoise-tts-v2/resolve/3704aea61678e7e468a06d8eea121dba368a798e/.models/dvae.pth" @@ -1547,13 +1547,6 @@ def get_dataset_list(dir="./training/"): def get_training_list(dir="./training/"): return sorted([f'./training/{d}/train.yaml' for d in os.listdir(dir) if os.path.isdir(os.path.join(dir, d)) and "train.yaml" in os.listdir(os.path.join(dir, d)) ]) -def do_gc(): - gc.collect() - try: - torch.cuda.empty_cache() - except Exception as e: - pass - def pad(num, zeroes): return str(num).zfill(zeroes+1) diff --git a/src/webui.py b/src/webui.py index a3a44e2..cdcb5f5 100755 --- a/src/webui.py +++ b/src/webui.py @@ -301,6 +301,7 @@ def setup_gradio(): result_voices = get_voice_list("./results/") autoregressive_models = get_autoregressive_models() dataset_list = get_dataset_list() + training_list = get_training_list() global GENERATE_SETTINGS_ARGS GENERATE_SETTINGS_ARGS = list(inspect.signature(generate_proxy).parameters.keys())[:-1] @@ -492,8 +493,7 @@ def setup_gradio(): with gr.Tab("Run Training"): with gr.Row(): with gr.Column(): - training_list = get_training_list() - training_configs = gr.Dropdown(label="Training Configuration", choices=training_list, value=training_list[0]) + training_configs = gr.Dropdown(label="Training Configuration", choices=training_list, value=training_list[0] if len(training_list) else "") refresh_configs = gr.Button(value="Refresh Configurations") training_output = gr.TextArea(label="Console Output", interactive=False, max_lines=8) verbose_training = gr.Checkbox(label="Verbose Console Output", value=True)