fix: Enhance emotion vector calculation in IndexTTS2Backend with emo_alpha adjustment

This commit is contained in:
2026-03-12 13:50:21 +08:00
parent 8aec4f6f44
commit c79ffac6d9

View File

@@ -475,8 +475,10 @@ class IndexTTS2Backend:
emo_vector = None emo_vector = None
if emo_text and len(emo_text.strip()) > 0: if emo_text and len(emo_text.strip()) > 0:
emo_vector = self._emo_text_to_vector(emo_text) raw_vector = self._emo_text_to_vector(emo_text)
logger.info(f"IndexTTS2 emo_text={repr(emo_text)} → emo_vector={emo_vector}") if raw_vector is not None:
emo_vector = [v * emo_alpha for v in raw_vector]
logger.info(f"IndexTTS2 emo_text={repr(emo_text)} emo_alpha={emo_alpha} → emo_vector={emo_vector}")
async with IndexTTS2Backend._gpu_lock: async with IndexTTS2Backend._gpu_lock:
await loop.run_in_executor( await loop.run_in_executor(