forked from mrq/ai-voice-cloning
forgot to fix reset settings to use the new arg-agnostic way
This commit is contained in:
parent
d250e0ec17
commit
8e890d3023
|
@ -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
|
||||||
|
|
11
src/webui.py
11
src/webui.py
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user