From 1b18b3e3351574daec52f6959ec4642ec4062ee1 Mon Sep 17 00:00:00 2001 From: mrq Date: Thu, 9 Mar 2023 02:27:20 +0000 Subject: [PATCH] forgot to save the simplified training input json first before touching any of the settings that dump to the yaml --- src/utils.py | 7 ++++--- src/webui.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils.py b/src/utils.py index 3273e8f..e52fd1a 100755 --- a/src/utils.py +++ b/src/utils.py @@ -1348,6 +1348,10 @@ def save_training_settings( **kwargs ): settings = {} settings.update(kwargs) + outjson = f'./training/{settings["voice"]}/train.json' + with open(outjson, 'w', encoding="utf-8") as f: + f.write(json.dumps(settings, indent='\t') ) + settings['dataset_path'] = f"./training/{settings['voice']}/train.txt" settings['validation_path'] = f"./training/{settings['voice']}/validation.txt" @@ -1428,9 +1432,6 @@ def save_training_settings( **kwargs ): if settings['dataset_path'] == settings['validation_path'] or not os.path.exists(settings['validation_path']): settings['validation_enabled'] = 'false' """ - outjson = f'./training/{settings["voice"]}/train.json' - with open(outjson, 'w', encoding="utf-8") as f: - f.write(json.dumps(settings, indent='\t') ) if settings['resume_state']: settings['source_model'] = f"# pretrain_model_gpt: {settings['source_model']}" diff --git a/src/webui.py b/src/webui.py index 7db6126..6691759 100755 --- a/src/webui.py +++ b/src/webui.py @@ -414,7 +414,7 @@ def setup_gradio(): TRAINING_SETTINGS["gpus"] = gr.Number(label="GPUs", value=get_device_count(), precision=0) TRAINING_SETTINGS["source_model"] = gr.Dropdown( choices=autoregressive_models, label="Source Model", type="value", value=autoregressive_models[0] ) - TRAINING_SETTINGS["resume_state"] = gr.Textbox(label="Resume State Path", placeholder="./training/${voice}/training_state/${last_state}.state") + TRAINING_SETTINGS["resume_state"] = gr.Textbox(label="Resume State Path", placeholder="./training/${voice}/finetune/training_state/${last_state}.state") TRAINING_SETTINGS["voice"] = gr.Dropdown( choices=dataset_list, label="Dataset", type="value", value=dataset_list[0] if len(dataset_list) else "" )