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

Clean up the __slots__ and overall inheritance structure in _grammar.py #1089

Closed
wants to merge 6 commits into from

Conversation

hudson-ai
Copy link
Collaborator

This PR primarily serves to align the attributes of our grammar classes with the arguments they are able to pass to the llguidance api.

The most notable change is that max_tokens is only allowed on classes that will serialize to Gen, Lexeme, or GenGrammar, where token_limit is reimplemented by wrapping a grammar in a GenGrammar pre-image (Subgrammar).

@hudson-ai hudson-ai requested a review from mmoskal December 11, 2024 18:10
@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 91.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 65.34%. Comparing base (c92d80a) to head (f7c385b).

Files with missing lines Patch % Lines
guidance/_grammar.py 91.37% 5 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1089      +/-   ##
==========================================
- Coverage   66.67%   65.34%   -1.33%     
==========================================
  Files          65       65              
  Lines        5173     5151      -22     
==========================================
- Hits         3449     3366      -83     
- Misses       1724     1785      +61     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hudson-ai
Copy link
Collaborator Author

Closing PR, as I'm going to combine it with the PR switching to llguidance JSON

@hudson-ai hudson-ai closed this Dec 11, 2024
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.

2 participants