fixes #132
This commit is contained in:
parent
fe03ae5839
commit
4b952ea52a
|
@ -2004,7 +2004,7 @@ def import_generate_settings(file = None):
|
||||||
'delimiter': None,
|
'delimiter': None,
|
||||||
'emotion': None,
|
'emotion': None,
|
||||||
'prompt': None,
|
'prompt': None,
|
||||||
'voice': None,
|
'voice': "random",
|
||||||
'mic_audio': None,
|
'mic_audio': None,
|
||||||
'voice_latents_chunks': None,
|
'voice_latents_chunks': None,
|
||||||
'candidates': None,
|
'candidates': None,
|
||||||
|
@ -2030,7 +2030,7 @@ def import_generate_settings(file = None):
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def reset_generation_settings():
|
def reset_generate_settings():
|
||||||
with open(f'./config/generate.json', 'w', encoding="utf-8") as f:
|
with open(f'./config/generate.json', 'w', encoding="utf-8") as f:
|
||||||
f.write(json.dumps({}, indent='\t') )
|
f.write(json.dumps({}, indent='\t') )
|
||||||
return import_generate_settings()
|
return import_generate_settings()
|
||||||
|
|
10
src/webui.py
10
src/webui.py
|
@ -155,9 +155,9 @@ def import_generate_settings_proxy( file=None ):
|
||||||
|
|
||||||
return tuple(res)
|
return tuple(res)
|
||||||
|
|
||||||
def reset_generate_settings_proxy( file=None ):
|
def reset_generate_settings_proxy():
|
||||||
global GENERATE_SETTINGS_ARGS
|
global GENERATE_SETTINGS_ARGS
|
||||||
settings = reset_generate_settings( file )
|
settings = reset_generate_settings()
|
||||||
|
|
||||||
res = []
|
res = []
|
||||||
for k in GENERATE_SETTINGS_ARGS:
|
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")
|
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")
|
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:
|
with gr.Column(visible=False) as col:
|
||||||
experimental_column = col
|
experimental_column = col
|
||||||
|
|
||||||
|
@ -697,8 +697,8 @@ def setup_gradio():
|
||||||
outputs=generate_settings
|
outputs=generate_settings
|
||||||
)
|
)
|
||||||
|
|
||||||
reset_generation_settings_button.click(
|
reset_generate_settings_button.click(
|
||||||
fn=reset_generation_settings_proxy,
|
fn=reset_generate_settings_proxy,
|
||||||
inputs=None,
|
inputs=None,
|
||||||
outputs=generate_settings
|
outputs=generate_settings
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user