-
Notifications
You must be signed in to change notification settings - Fork 13
fix: generated caption no longer gets truncated #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ServeurpersoCom
merged 1 commit into
ServeurpersoCom:master
from
jdluzen:fix/captiontruncate
Mar 10, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep CFG off for every phase-1 fill path.
Lines 794-797 only force
fill_cfg = 1.0ffor lyrics oruse_cot_caption, but this branch always callsgenerate_phase1_batch()to produce text that is later parsed back intoAcePrompt. Metadata-only fill therefore still runs textual sampling with CFG, so one fill mode keeps the same truncation/garbling risk this change is trying to remove.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A 1 sample test with instrumental works, but a non-instrumental test when generating lyrics truncated the caption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdluzen, thanks for testing! That's a very useful data point.Since the PR already sets
fill_cfg = 1.0fwhenneed_lyrics = true, CFG is not the active issue for the lyrics path. The likely culprit is that the old code also resetfill_top_pandfill_top_kfor lyrics specifically, and those lines were removed in this PR:Without those overrides, lyrics generation now uses whatever
top_pandtop_kvalues come from the request. A restrictivetop_p < 1.0(or a non-zerotop_k) shrinks the candidate pool during free-text sampling, which can cause the sampler to pickTOKEN_IM_ENDearly and truncate mid-sentence.A secondary suspect is the FSM: with
vocal_language = "en"(the example payload in your PR),fsm.force_language("en")is active during lyrics fill. If the language-forcing masks too aggressively, it can also block valid continuation tokens.Suggested fix — restore the sampling overrides for the lyrics path alongside the CFG change:
This restores the old behavior for the lyrics path while keeping the CFG fix for
use_cot_caption. If you're still seeing truncation after this, the FSM language-forcing during caption expansion is worth investigating next (it may make sense to skipforce_languagewhen the fill step is generating a free-form caption rather than structured metadata).