This commit is contained in:
mrq 2023-03-09 00:53:00 +00:00
parent b0baa1909a
commit ef7b957fff
2 changed files with 9 additions and 5 deletions

View File

@ -34,7 +34,7 @@ from datetime import timedelta
from tortoise.api import TextToSpeech, MODELS, get_model_path, pad_or_truncate 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 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, set_device_name, get_device_count from tortoise.utils.device import get_device_name, set_device_name, get_device_count, get_device_vram
MODELS['dvae.pth'] = "https://huggingface.co/jbetker/tortoise-tts-v2/resolve/3704aea61678e7e468a06d8eea121dba368a798e/.models/dvae.pth" MODELS['dvae.pth'] = "https://huggingface.co/jbetker/tortoise-tts-v2/resolve/3704aea61678e7e468a06d8eea121dba368a798e/.models/dvae.pth"
@ -1278,6 +1278,8 @@ def optimize_training_settings( **kwargs ):
messages.append(f"Batch size is not evenly divisible by the gradient accumulation size, adjusting gradient accumulation size to: {settings['gradient_accumulation_size']}") messages.append(f"Batch size is not evenly divisible by the gradient accumulation size, adjusting gradient accumulation size to: {settings['gradient_accumulation_size']}")
print("VRAM", get_device_vram())
iterations = calc_iterations(epochs=settings['epochs'], lines=lines, batch_size=settings['batch_size']) iterations = calc_iterations(epochs=settings['epochs'], lines=lines, batch_size=settings['batch_size'])
if settings['epochs'] < settings['print_rate']: if settings['epochs'] < settings['print_rate']:
@ -1828,10 +1830,12 @@ def import_generate_settings(file="./config/generate.json"):
res = [] res = []
if GENERATE_SETTINGS_ARGS is not None: if GENERATE_SETTINGS_ARGS is not None:
for k in GENERATE_SETTINGS_ARGS: for k in GENERATE_SETTINGS_ARGS:
res.append(defaults[k] if not settings or settings[k] is None else settings[k]) if k not in defaults:
continue
res.append(defaults[k] if not settings or k not in settings or not settings[k] is None else settings[k])
else: else:
for k in defaults: for k in defaults:
res.append(defaults[k] if not settings or settings[k] is None else settings[k]) res.append(defaults[k] if not settings or k not in settings or not settings[k] is None else settings[k])
return tuple(res) return tuple(res)

@ -1 +1 @@
Subproject commit cc36c0997c8711889ef8028002fc9e41abd5c5f0 Subproject commit bbeee40ab3ee39dd16a1ebd2388bf82402776664