Skip to content

Commit

Permalink
add model refresh button to stable audio UI
Browse files Browse the repository at this point in the history
  • Loading branch information
rsxdalv committed Oct 7, 2024
1 parent 2a70117 commit 94ffe52
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tts_webui/stable_audio/stable_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from tts_webui.utils.torch_clear_memory import torch_clear_memory
from tts_webui.utils.prompt_to_title import prompt_to_title
from tts_webui.tortoise.gr_reload_button import gr_open_button_simple, gr_reload_button

LOCAL_DIR_BASE = os.path.join("data", "models", "stable-audio")
LOCAL_DIR_BASE_ABSOLUTE = get_path_from_root(*LOCAL_DIR_BASE.split(os.path.sep))
Expand Down Expand Up @@ -157,6 +158,13 @@ def model_select_ui():
value=pretrained_name,
)

gr_open_button_simple(LOCAL_DIR_BASE, api_name="stable_audio_open_models")
gr_reload_button().click(
fn=lambda: gr.Dropdown(choices=get_model_list()),
outputs=[model_select],
api_name="stable_audio_refresh_models",
)

with gr.Column():
gr.Markdown(
"""
Expand Down

0 comments on commit 94ffe52

Please sign in to comment.