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

enh: JSON schema for guided generation now optionally respects field order #264

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

jeffreyftang
Copy link
Contributor

What does this PR do?

The regex used by Outlines for imposing a JSON schema on model outputs inherently enforces an ordering on object fields. This can result in degraded performance when applying a schema if the underlying model strongly prefers to generate fields in a different order.

Following this PR, the user can now use an OrderedDict or similar construction to ensure field ordering within the generated JSON object when such ordering turns out to be important for quality.

@jeffreyftang jeffreyftang merged commit dd68924 into main Feb 20, 2024
2 checks passed
@jeffreyftang jeffreyftang deleted the improve-ft-guided-gen branch February 20, 2024 23:20
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.

None yet

2 participants