From 9b0137766703f886705812eb80e25b3d126b009a Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 29 Mar 2023 19:53:23 +0000 Subject: [PATCH] only include auto in the list of models under setting, nothing else --- src/utils.py | 8 ++++++-- src/webui.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/utils.py b/src/utils.py index a82285e..22d848d 100755 --- a/src/utils.py +++ b/src/utils.py @@ -2087,7 +2087,7 @@ def get_voice_list(dir=get_voice_dir(), append_defaults=False): return res -def get_autoregressive_models(dir="./models/finetunes/", prefixed=False): +def get_autoregressive_models(dir="./models/finetunes/", prefixed=False, auto=False): os.makedirs(dir, exist_ok=True) base = [get_model_path('autoregressive.pth')] halfp = get_halfp_model_path() @@ -2112,7 +2112,11 @@ def get_autoregressive_models(dir="./models/finetunes/", prefixed=False): res[i] = f'[{shorthash}] {path}' - return ["auto"] + relative_paths(res) + paths = relative_paths(res) + if auto: + paths = ["auto"] + paths + + return paths def get_diffusion_models(dir="./models/finetunes/", prefixed=False): return relative_paths([ get_model_path('diffusion_decoder.pth') ]) diff --git a/src/webui.py b/src/webui.py index 1abed5a..7824d57 100755 --- a/src/webui.py +++ b/src/webui.py @@ -610,7 +610,7 @@ def setup_gradio(): with gr.Column(): # EXEC_SETTINGS['tts_backend'] = gr.Dropdown(TTSES, label="TTS Backend", value=args.tts_backend if args.tts_backend else TTSES[0]) - EXEC_SETTINGS['autoregressive_model'] = gr.Dropdown(choices=autoregressive_models, label="Autoregressive Model", value=args.autoregressive_model if args.autoregressive_model else autoregressive_models[0]) + EXEC_SETTINGS['autoregressive_model'] = gr.Dropdown(choices=["auto"] + autoregressive_models, label="Autoregressive Model", value=args.autoregressive_model if args.autoregressive_model else "auto") EXEC_SETTINGS['diffusion_model'] = gr.Dropdown(choices=diffusion_models, label="Diffusion Model", value=args.diffusion_model if args.diffusion_model else diffusion_models[0]) EXEC_SETTINGS['vocoder_model'] = gr.Dropdown(VOCODERS, label="Vocoder", value=args.vocoder_model if args.vocoder_model else VOCODERS[-1]) EXEC_SETTINGS['tokenizer_json'] = gr.Dropdown(tokenizer_jsons, label="Tokenizer JSON Path", value=args.tokenizer_json if args.tokenizer_json else tokenizer_jsons[0])