Skip to content

Fix guidance usage in continuous decoding#1870

Merged
kunal-vaishnavi merged 3 commits into
mainfrom
kvaishnavi/fix-guidance-multi-turn
Nov 14, 2025
Merged

Fix guidance usage in continuous decoding#1870
kunal-vaishnavi merged 3 commits into
mainfrom
kvaishnavi/fix-guidance-multi-turn

Conversation

@kunal-vaishnavi
Copy link
Copy Markdown
Contributor

Description

This PR resets the guidance logits processor when generation is completed and fixes the last action that occurred.

Motivation and Context

This PR fixes a bug with providing grammars in multi-turn conversations where the generator is re-used.

Copy link
Copy Markdown
Contributor

@JC1DA JC1DA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kunal-vaishnavi kunal-vaishnavi merged commit bb0afa3 into main Nov 14, 2025
15 of 16 checks passed
@kunal-vaishnavi kunal-vaishnavi deleted the kvaishnavi/fix-guidance-multi-turn branch November 14, 2025 06:41
kunal-vaishnavi added a commit that referenced this pull request Nov 14, 2025
### Description

This PR resets the guidance logits processor when generation is
completed and fixes the last action that occurred.

### Motivation and Context

This PR fixes a bug with providing grammars in multi-turn conversations
where the generator is re-used.
@baijumeswani baijumeswani mentioned this pull request Feb 24, 2026
baijumeswani added a commit that referenced this pull request Feb 24, 2026
Fixes bug introduced in
#1870 where we were
computing the mask after resetting the internal state of the guidance
processor.

Also fixes these issues:
- Enables debug build when guidance is enabled.
- Fixes bug where we log without checking if logging was enabled.
baijumeswani added a commit that referenced this pull request Feb 24, 2026
Fixes bug introduced in
#1870 where we were
computing the mask after resetting the internal state of the guidance
processor.

Also fixes these issues:
- Enables debug build when guidance is enabled.
- Fixes bug where we log without checking if logging was enabled.
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.

3 participants