Skip to content

Add support for fixed character-level StreamAtt history selection#40

Open
sarapapi wants to merge 4 commits into
mainfrom
fix_streamatt_char
Open

Add support for fixed character-level StreamAtt history selection#40
sarapapi wants to merge 4 commits into
mainfrom
fix_streamatt_char

Conversation

@sarapapi

@sarapapi sarapapi commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

FixedWordsTextHistory counts words using the BOW prefix () to identify word boundaries, which works well for space-separated languages but not for character-level languages (e.g., Chinese, Japanese) where BOW markers are sparse. When few tokens carry a BOW prefix, the word counter never reaches history_words, the text history is never trimmed, and the audio buffer grows unboundedly, causing AlignAtt to progressively cut all newly generated tokens.

This PR extends the FixedWords-style approach to character-level languages by introducing FixedCharsTextHistory, which counts every token as one unit (mirroring how character-level segmenters treat individual CJK characters). A dedicated config file (seamless_streamatt_char.yaml) is provided, pairing FixedCharsTextHistory with word_level_postprocess: False, required to prevent _strip_incomplete_words from discarding valid CJK tokens.

@sarapapi sarapapi requested a review from mgaido91 July 3, 2026 11:05
@sarapapi sarapapi self-assigned this Jul 3, 2026
@sarapapi sarapapi added the enhancement New feature or request label Jul 3, 2026
@mgaido91

mgaido91 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

LGTM apart one minor comment, thanks

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants