Skip to content

SOTA Open Source TTS

Optimize drifiting

Lengyue4a0ec974d15c
diff --git a/tools/llama/generate.py b/tools/llama/generate.py
index 0bc479b..2d17b84 100644
--- a/tools/llama/generate.py
+++ b/tools/llama/generate.py
@@ -540,9 +540,9 @@ def main(
if i != 0 and i % 2 == 0:
i -= 1
- # Rotate the list
+ # Rotate the list, always make sure first segment is included to avoid drift
if i < len(global_encoded) - 2:
- partial_encoded = global_encoded[-i:]
+ partial_encoded = global_encoded[:2] + global_encoded[-i:]
else:
partial_encoded = global_encoded