Skip to content
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

fix: handle batches with and without grammars #1676

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

drbh
Copy link
Collaborator

@drbh drbh commented Mar 26, 2024

This PR correctly handles batches with a mixture of constrained and non constrained generations.

Currently if batch contains mixed generations the generation will throw an error because it will incorrectly attempt to constrain a request with an empty grammar.

We now handled None grammars and only apply the mask if needed

Fixes: #1643

@drbh drbh merged commit 762dbf3 into main Mar 28, 2024
7 checks passed
@drbh drbh deleted the handle-concurrent-mixed-grammar-requests branch March 28, 2024 16:02
kdamaszk pushed a commit to kdamaszk/tgi-gaudi that referenced this pull request Apr 29, 2024
This PR correctly handles batches with a mixture of constrained and non
constrained generations.

Currently if batch contains mixed generations the generation will throw
an error because it will incorrectly attempt to constrain a request with
an empty grammar.

We now handled `None` grammars and only apply the mask if needed

Fixes:
huggingface#1643
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.

Concurrent grammar requests
2 participants