Skip to content

SOTA Open Source TTS

Update webui.py (#699)

spicysama30e1762594bd
diff --git a/tools/webui.py b/tools/webui.py
index ef6ae65..c2685f6 100644
--- a/tools/webui.py
+++ b/tools/webui.py
@@ -23,7 +23,7 @@ from fish_speech.i18n import i18n
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)