fixed last generation settings not actually load because brain worms

This commit is contained in:
mrq 2023-03-12 15:49:50 +00:00
parent 9594a960b0
commit 9238df0b03
2 changed files with 8 additions and 5 deletions

View File

@ -1802,7 +1802,10 @@ def save_args_settings():
f.write(json.dumps(settings, indent='\t') )
# super kludgy )`;
def import_generate_settings(file="./config/generate.json"):
def import_generate_settings(file = None):
if not file:
file = "./config/generate.json"
res = {
'text': None,
'delimiter': None,
@ -1828,8 +1831,10 @@ def import_generate_settings(file="./config/generate.json"):
}
settings, _ = read_generate_settings(file, read_latents=False)
if settings is not None:
res.update(settings)
return res
def reset_generation_settings():

View File

@ -791,10 +791,8 @@ def setup_gradio():
outputs=training_configuration_output #console_output
)
#care: this overrides all the above specified default values
#specifically default voice not being null and empty prompt causing errors
#if os.path.isfile('./config/generate.json'):
# ui.load(import_generate_settings_proxy, inputs=None, outputs=generate_settings)
if os.path.isfile('./config/generate.json'):
ui.load(import_generate_settings_proxy, inputs=None, outputs=generate_settings)
if args.check_for_updates:
ui.load(check_for_updates)