Skip to content

Fixes #424: "Turbo can only generate small bits of audio (~350 chars) correctly without hallucinating"#457

Open
ahmadshajhan wants to merge 8 commits intoresemble-ai:masterfrom
ahmadshajhan:master
Open

Fixes #424: "Turbo can only generate small bits of audio (~350 chars) correctly without hallucinating"#457
ahmadshajhan wants to merge 8 commits intoresemble-ai:masterfrom
ahmadshajhan:master

Conversation

@ahmadshajhan
Copy link

Summary
This PR addresses the critical "hallucination" issue (#424) where the Turbo model produces confusing text when handling input longer than about 350 characters.

By using a smart chunking strategy, the system now automatically identifies long input and divides it into clear, sentence-based segments. These segments are processed one at a time and then combined smoothly, allowing for nearly unlimited text length without loss of quality.

Key Changes
Logic & Stability

Automatic Length Detection: The
generate
method now tracks input length. If the text goes over 300 characters, the safety protocol activates.
Context-Aware Chunking: Rather than making random cuts, the text is divided using a regex pattern
([.!?]+(?:\s+|$))
to ensure breaks occur naturally at sentence endings. This maintains prosody and flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant