From 9238df0b03b92df188bc87267db7a2bac78d567d Mon Sep 17 00:00:00 2001 From: mrq Date: Sun, 12 Mar 2023 15:49:50 +0000 Subject: [PATCH] fixed last generation settings not actually load because brain worms --- src/utils.py | 7 ++++++- src/webui.py | 6 ++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils.py b/src/utils.py index 3b4fa00..1503afa 100755 --- a/src/utils.py +++ b/src/utils.py @@ -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(): diff --git a/src/webui.py b/src/webui.py index ff13db4..a3a44e2 100755 --- a/src/webui.py +++ b/src/webui.py @@ -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)