This commit is contained in:
mrq 2023-03-14 18:46:20 +00:00
parent fe03ae5839
commit 4b952ea52a
2 changed files with 7 additions and 7 deletions

View File

@ -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()

View File

@ -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
)