Fix: conflict of current_model in model_holder for multiple requests

This commit is contained in:
litagin02
2024-02-07 15:33:17 +09:00
parent 78689f6c2a
commit d51c8bf639
2 changed files with 17 additions and 1 deletions

6
app.py
View File

@@ -36,6 +36,8 @@ languages = [l.value for l in Languages]
def tts_fn(
model_name,
model_path,
text,
language,
reference_audio_path,
@@ -54,7 +56,7 @@ def tts_fn(
use_tone,
speaker,
):
assert model_holder.current_model is not None
model_holder.load_model_gr(model_name, model_path)
wrong_tone_message = ""
kata_tone: Optional[list[tuple[str, int]]] = None
@@ -418,6 +420,8 @@ if __name__ == "__main__":
tts_button.click(
tts_fn,
inputs=[
model_name,
model_path,
text_input,
language,
ref_audio_path,