[Bugfix] Invalidate stale ref_audio cache on local file modification (#4873) (#5670)

Signed-off-by: pranavthakur0-0 <pranavthakurdew@gmail.com>
Co-authored-by: Zhou Taichang <tzhouam@connect.ust.hk>
This commit is contained in:
Pranav ThakurandZhou Taichang authored and GitHub committed 2026-08-25 10:06:32 +08:00
1 parent 50b8a150f9
commit 53b60bd9bc
10 files changed
+675 -103

No files matched your search

@@ -49,13 +49,14 @@ class FishSpeechAdapter(ARTTSAdapter):
) -> PreparedRequest:
server = self.ctx.server
ref_audio_data = None
tts_params: dict = {}
if request.ref_audio is not None:
wav_list, sr = await server._resolve_ref_audio(request.ref_audio)
wav_list, sr, cache_key = await server._resolve_ref_audio(request.ref_audio)
ref_audio_data = (wav_list, sr)
tts_params["ref_audio_cache_key"] = cache_key
prompt = await server._build_fish_speech_prompt_async(
request, ref_audio_data=ref_audio_data, has_inline_ref_audio=has_inline_ref_audio
)
tts_params = {}
prompt["cache_salt"] = conditioning_cache_salt(request, tts_params)
return PreparedRequest(prompt=prompt, tts_params=tts_params, model_type="fish_speech")