From 1f4cfbd08859dc38413efdb97ea80cc7767dcd32 Mon Sep 17 00:00:00 2001 From: ChasonJiang <1440499136@qq.com> Date: Sat, 17 Aug 2024 17:14:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GPT_SoVITS/TTS_infer_pack/TTS.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GPT_SoVITS/TTS_infer_pack/TTS.py b/GPT_SoVITS/TTS_infer_pack/TTS.py index 36a0f5e..2fd39ad 100644 --- a/GPT_SoVITS/TTS_infer_pack/TTS.py +++ b/GPT_SoVITS/TTS_infer_pack/TTS.py @@ -413,7 +413,10 @@ class TTS: def _set_ref_spec(self, ref_audio_path): spec = self._get_ref_spec(ref_audio_path) - self.prompt_cache["refer_spec"].append(spec) + if self.prompt_cache["refer_spec"] in [[],None]: + self.prompt_cache["refer_spec"]=[spec] + else: + self.prompt_cache["refer_spec"][0] = spec def _get_ref_spec(self, ref_audio_path): audio = load_audio(ref_audio_path, int(self.configs.sampling_rate))