Skip to content

Validate --source so invalid values don’t raise KeyError#576

Open
dhunganapramod9 wants to merge 1 commit intokarpathy:masterfrom
dhunganapramod9:fix/source-argparse-choices
Open

Validate --source so invalid values don’t raise KeyError#576
dhunganapramod9 wants to merge 1 commit intokarpathy:masterfrom
dhunganapramod9:fix/source-argparse-choices

Conversation

@dhunganapramod9
Copy link

Invalid --source (e.g. foo) caused a KeyError in load_model. Added choices=["sft", "rl"] so argparse rejects bad values with a clear error.

Copy link
Collaborator

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

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

This is not a bad idea - are there similar places in the codebase that could be updated? Would be nice to do it all in one PR for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants