Repository navigation
Preserve Drama3 history anchors and fit generation to context - #1197
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Drama3 previously conditioned each long-form chunk on only the latest generated chunk and rejected requests whenever the prompt plus the entire requested token allowance exceeded context capacity. This retains the first generated chunk as an anchor alongside the latest chunk, and treats
max_tokensas an upper bound limited by the remaining context.Automatic history is reduced in upstream order: first + latest, first only, then none. References and caller-supplied previous takes remain required and ordered. An oversized required prompt still fails. Budget reductions are logged, and exhausting the effective budget sets
reached_limit.Changes are model-local, with documentation and prompt tests. Offline and streaming share the policy. Chunk-size/token defaults, BF16 reference encoding and empty-generation errors are unchanged.
Validation
CUDA A/B against main on RTX 5090, native Q4_K_S experts with Q8_0 tower projections, eight threads, full-resident inference,
perf_mode=off, context 2048, chunk size 128 andmax_tokens=1024. Five English passages of approximately 1,000 characters, with identical fixed seeds and settings on both sides:Speaker counts use Nemotron 3 Diarization with no forced speaker count. WER uses Qwen3-ASR 1.7B and the same English normalization on both sides. All ten requests ended without hitting generation limits; all five first-two-chunk audio/code prefixes were byte-identical. These results support improved continuity on this cohort, not universal quality improvement. An earlier shorter passage with another seed gained one word after the change, independently confirmed by two ASR models.
Additional checks:
max_tokens=1024now completes naturally. Its WAV matches main with a manually reduced cap byte-for-byte.Addresses items 3 and 4 of #1188; the other requests in that issue remain separate.