forgot to fix reset settings to use the new arg-agnostic way

This commit is contained in:
mrq 2023-03-10 13:49:39 +00:00
parent d250e0ec17
commit 8e890d3023
2 changed files with 7 additions and 9 deletions

View File

@ -1857,11 +1857,6 @@ def import_generate_settings(file="./config/generate.json"):
res.update(settings) res.update(settings)
return res return res
def reset_generation_settings():
with open(f'./config/generate.json', 'w', encoding="utf-8") as f:
f.write(json.dumps({}, indent='\t') )
return import_generate_settings()
def read_generate_settings(file, read_latents=True): def read_generate_settings(file, read_latents=True):
j = None j = None
latents = None latents = None

View File

@ -152,11 +152,14 @@ def import_generate_settings_proxy( file=None ):
res = [] res = []
for k in GENERATE_SETTINGS_ARGS: for k in GENERATE_SETTINGS_ARGS:
res.append(settings[k] if k in settings else None) res.append(settings[k] if k in settings else None)
print(GENERATE_SETTINGS_ARGS)
print(settings)
print(res)
return tuple(res) return tuple(res)
def reset_generation_settings_proxy():
with open(f'./config/generate.json', 'w', encoding="utf-8") as f:
f.write(json.dumps({}, indent='\t') )
return import_generate_settings_proxy()
def compute_latents_proxy(voice, voice_latents_chunks, progress=gr.Progress(track_tqdm=True)): def compute_latents_proxy(voice, voice_latents_chunks, progress=gr.Progress(track_tqdm=True)):
compute_latents( voice=voice, voice_latents_chunks=voice_latents_chunks, progress=progress ) compute_latents( voice=voice, voice_latents_chunks=voice_latents_chunks, progress=progress )
return voice return voice
@ -662,7 +665,7 @@ def setup_gradio():
) )
reset_generation_settings_button.click( reset_generation_settings_button.click(
fn=reset_generation_settings, fn=reset_generation_settings_proxy,
inputs=None, inputs=None,
outputs=generate_settings outputs=generate_settings
) )