From 4b952ea52a68df2a56d3ec75e7a9f8f183c9024e Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 14 Mar 2023 18:46:20 +0000 Subject: [PATCH] fixes #132 --- src/utils.py | 4 ++-- src/webui.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils.py b/src/utils.py index e917739..2fe2e7e 100755 --- a/src/utils.py +++ b/src/utils.py @@ -2004,7 +2004,7 @@ def import_generate_settings(file = None): 'delimiter': None, 'emotion': None, 'prompt': None, - 'voice': None, + 'voice': "random", 'mic_audio': None, 'voice_latents_chunks': None, 'candidates': None, @@ -2030,7 +2030,7 @@ def import_generate_settings(file = None): return res -def reset_generation_settings(): +def reset_generate_settings(): with open(f'./config/generate.json', 'w', encoding="utf-8") as f: f.write(json.dumps({}, indent='\t') ) return import_generate_settings() diff --git a/src/webui.py b/src/webui.py index 14a5243..86e946c 100755 --- a/src/webui.py +++ b/src/webui.py @@ -155,9 +155,9 @@ def import_generate_settings_proxy( file=None ): return tuple(res) -def reset_generate_settings_proxy( file=None ): +def reset_generate_settings_proxy(): global GENERATE_SETTINGS_ARGS - settings = reset_generate_settings( file ) + settings = reset_generate_settings() res = [] for k in GENERATE_SETTINGS_ARGS: @@ -359,7 +359,7 @@ def setup_gradio(): GENERATE_SETTINGS["temperature"] = gr.Slider(value=0.2, minimum=0, maximum=1, step=0.1, label="Temperature") show_experimental_settings = gr.Checkbox(label="Show Experimental Settings") - reset_generation_settings_button = gr.Button(value="Reset to Default") + reset_generate_settings_button = gr.Button(value="Reset to Default") with gr.Column(visible=False) as col: experimental_column = col @@ -697,8 +697,8 @@ def setup_gradio(): outputs=generate_settings ) - reset_generation_settings_button.click( - fn=reset_generation_settings_proxy, + reset_generate_settings_button.click( + fn=reset_generate_settings_proxy, inputs=None, outputs=generate_settings )