Spaces:
Build error
Build error
mrq commited on
Commit ·
ccbf2e6
1
Parent(s): 9238df0
blame https://git.ecker.tech/mrq/ai-voice-cloning/pulls/122
Browse files- src/utils.py +1 -8
- src/webui.py +2 -2
src/utils.py
CHANGED
|
@@ -35,7 +35,7 @@ from datetime import timedelta
|
|
| 35 |
from tortoise.api import TextToSpeech, MODELS, get_model_path, pad_or_truncate
|
| 36 |
from tortoise.utils.audio import load_audio, load_voice, load_voices, get_voice_dir, get_voices
|
| 37 |
from tortoise.utils.text import split_and_recombine_text
|
| 38 |
-
from tortoise.utils.device import get_device_name, set_device_name, get_device_count, get_device_vram
|
| 39 |
|
| 40 |
MODELS['dvae.pth'] = "https://huggingface.co/jbetker/tortoise-tts-v2/resolve/3704aea61678e7e468a06d8eea121dba368a798e/.models/dvae.pth"
|
| 41 |
|
|
@@ -1547,13 +1547,6 @@ def get_dataset_list(dir="./training/"):
|
|
| 1547 |
def get_training_list(dir="./training/"):
|
| 1548 |
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)) ])
|
| 1549 |
|
| 1550 |
-
def do_gc():
|
| 1551 |
-
gc.collect()
|
| 1552 |
-
try:
|
| 1553 |
-
torch.cuda.empty_cache()
|
| 1554 |
-
except Exception as e:
|
| 1555 |
-
pass
|
| 1556 |
-
|
| 1557 |
def pad(num, zeroes):
|
| 1558 |
return str(num).zfill(zeroes+1)
|
| 1559 |
|
|
|
|
| 35 |
from tortoise.api import TextToSpeech, MODELS, get_model_path, pad_or_truncate
|
| 36 |
from tortoise.utils.audio import load_audio, load_voice, load_voices, get_voice_dir, get_voices
|
| 37 |
from tortoise.utils.text import split_and_recombine_text
|
| 38 |
+
from tortoise.utils.device import get_device_name, set_device_name, get_device_count, get_device_vram, do_gc
|
| 39 |
|
| 40 |
MODELS['dvae.pth'] = "https://huggingface.co/jbetker/tortoise-tts-v2/resolve/3704aea61678e7e468a06d8eea121dba368a798e/.models/dvae.pth"
|
| 41 |
|
|
|
|
| 1547 |
def get_training_list(dir="./training/"):
|
| 1548 |
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)) ])
|
| 1549 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1550 |
def pad(num, zeroes):
|
| 1551 |
return str(num).zfill(zeroes+1)
|
| 1552 |
|
src/webui.py
CHANGED
|
@@ -301,6 +301,7 @@ def setup_gradio():
|
|
| 301 |
result_voices = get_voice_list("./results/")
|
| 302 |
autoregressive_models = get_autoregressive_models()
|
| 303 |
dataset_list = get_dataset_list()
|
|
|
|
| 304 |
|
| 305 |
global GENERATE_SETTINGS_ARGS
|
| 306 |
GENERATE_SETTINGS_ARGS = list(inspect.signature(generate_proxy).parameters.keys())[:-1]
|
|
@@ -492,8 +493,7 @@ def setup_gradio():
|
|
| 492 |
with gr.Tab("Run Training"):
|
| 493 |
with gr.Row():
|
| 494 |
with gr.Column():
|
| 495 |
-
training_list =
|
| 496 |
-
training_configs = gr.Dropdown(label="Training Configuration", choices=training_list, value=training_list[0])
|
| 497 |
refresh_configs = gr.Button(value="Refresh Configurations")
|
| 498 |
training_output = gr.TextArea(label="Console Output", interactive=False, max_lines=8)
|
| 499 |
verbose_training = gr.Checkbox(label="Verbose Console Output", value=True)
|
|
|
|
| 301 |
result_voices = get_voice_list("./results/")
|
| 302 |
autoregressive_models = get_autoregressive_models()
|
| 303 |
dataset_list = get_dataset_list()
|
| 304 |
+
training_list = get_training_list()
|
| 305 |
|
| 306 |
global GENERATE_SETTINGS_ARGS
|
| 307 |
GENERATE_SETTINGS_ARGS = list(inspect.signature(generate_proxy).parameters.keys())[:-1]
|
|
|
|
| 493 |
with gr.Tab("Run Training"):
|
| 494 |
with gr.Row():
|
| 495 |
with gr.Column():
|
| 496 |
+
training_configs = gr.Dropdown(label="Training Configuration", choices=training_list, value=training_list[0] if len(training_list) else "")
|
|
|
|
| 497 |
refresh_configs = gr.Button(value="Refresh Configurations")
|
| 498 |
training_output = gr.TextArea(label="Console Output", interactive=False, max_lines=8)
|
| 499 |
verbose_training = gr.Checkbox(label="Verbose Console Output", value=True)
|