Refactor: separate adjust_voice() function from tts_model.py

This commit is contained in:
tsukumi
2024-03-09 17:45:56 +00:00
parent 61e2a1deae
commit 96d22102f3
4 changed files with 127 additions and 102 deletions

View File

@@ -446,7 +446,7 @@ def create_inference_app(model_holder: ModelHolder) -> gr.Blocks:
)
model_name.change(
model_holder.update_model_files_gr,
model_holder.update_model_files_for_gradio,
inputs=[model_name],
outputs=[model_path],
)
@@ -454,12 +454,12 @@ def create_inference_app(model_holder: ModelHolder) -> gr.Blocks:
model_path.change(make_non_interactive, outputs=[tts_button])
refresh_button.click(
model_holder.update_model_names_gr,
model_holder.update_model_names_for_gradio,
outputs=[model_name, model_path, tts_button],
)
load_button.click(
model_holder.load_model_gr,
model_holder.load_model_for_gradio,
inputs=[model_name, model_path],
outputs=[style, tts_button, speaker],
)

View File

@@ -255,7 +255,7 @@ def simple_tts(model_name, text, style=DEFAULT_STYLE, style_weight=1.0):
def update_two_model_names_dropdown(model_holder: ModelHolder):
new_names, new_files, _ = model_holder.update_model_names_gr()
new_names, new_files, _ = model_holder.update_model_names_for_gradio()
return new_names, new_files, new_names, new_files
@@ -444,12 +444,12 @@ def create_merge_app(model_holder: ModelHolder) -> gr.Blocks:
audio_output = gr.Audio(label="結果")
model_name_a.change(
model_holder.update_model_files_gr,
model_holder.update_model_files_for_gradio,
inputs=[model_name_a],
outputs=[model_path_a],
)
model_name_b.change(
model_holder.update_model_files_gr,
model_holder.update_model_files_for_gradio,
inputs=[model_name_b],
outputs=[model_path_b],
)