From 30e1762594bdc6b28eeaee6ae1ce06c4ab7807e2 Mon Sep 17 00:00:00 2001 From: spicysama Date: Wed, 4 Dec 2024 00:03:29 +0800 Subject: [PATCH] Update webui.py (#699) * Update webui.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- tools/webui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/webui.py b/tools/webui.py index ef6ae650..c2685f67 100644 --- a/tools/webui.py +++ b/tools/webui.py @@ -23,7 +23,7 @@ from fish_speech.text.chn_text_norm.text import Text as ChnNormedText from fish_speech.utils import autocast_exclude_mps, set_seed from tools.api import decode_vq_tokens, encode_reference -from tools.file import AUDIO_EXTENSIONS, list_files +from tools.file import AUDIO_EXTENSIONS, audio_to_bytes, list_files, read_ref_text from tools.llama.generate import ( GenerateRequest, GenerateResponse, @@ -87,6 +87,7 @@ def build_html_error_message(error): def inference(req: ServeTTSRequest): idstr: str | None = req.reference_id + prompt_tokens, prompt_texts = [], [] if idstr is not None: ref_folder = Path("references") / idstr ref_folder.mkdir(parents=True, exist_ok=True)