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

convert enum to str when referencing #66

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Conversation

cdoern
Copy link
Contributor

@cdoern cdoern commented Jun 25, 2024

click does not support an enum type for click.choice. This means that in the CLI we need to somehow get from str -> enum to pass to the library.

Adding this use_enum_values, allows a user to specify things like nf4 and None as strs in their config.yaml and they are seen as valid by the library.

@JamesKunstle
Copy link
Contributor

Understood once I read the docs:

use_enum_value:

Whether to populate models with the value property of enums, rather than the raw enum. This may be useful if you want to serialize model.model_dump() later. Defaults to False.

Copy link
Member

@RobotSail RobotSail left a comment

Choose a reason for hiding this comment

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

LGTM

@RobotSail RobotSail merged commit 700dad0 into instructlab:main Jun 25, 2024
5 of 6 checks passed
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