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

Use Enums for multiple choices #1218

Open
rlouf opened this issue Oct 20, 2024 · 0 comments
Open

Use Enums for multiple choices #1218

rlouf opened this issue Oct 20, 2024 · 0 comments
Assignees
Labels
enhancement structured generation Linked to structured generation

Comments

@rlouf
Copy link
Member

rlouf commented Oct 20, 2024

Presentation of the new feature

To make the model choose between different options we currently use generate.choice. Here I suggest we also use Enums to represent multiple choices:

from enum import Enum


class choices(Enum):
    a: str = "Choice A"
    b: str = "Choice B"

Where does it fit in Outlines?

This will probably make more sense once the API has been refactored.

@rlouf rlouf added structured generation Linked to structured generation enhancement labels Oct 20, 2024
@rlouf rlouf self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement structured generation Linked to structured generation
Projects
None yet
Development

No branches or pull requests

1 participant