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

Add special errors for bad chat/ift types #1437

Merged
merged 7 commits into from
Aug 8, 2024

Conversation

milocress
Copy link
Contributor

Adds the InvalidExampleTypeError and InvalidMessageTypeError for when example is not a Mapping and message is not an Iterable, respectively.

@milocress milocress requested a review from a team as a code owner August 7, 2024 19:23
Copy link
Collaborator

@dakinggg dakinggg left a comment

Choose a reason for hiding this comment

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

Can you manual test this and make sure the error is raised as expected?

@milocress
Copy link
Contributor Author

milocress commented Aug 8, 2024

Can you manual test this and make sure the error is raised as expected?

hf-nopeft-noseqpar-8b-noloadpath-ayi0lW for the extraneous keys:

[rank0]: UnknownExampleTypeError: Found keys {'response', 'prompt', 'random_extra_key'}
[rank0]: in dataset. Unknown example type. For prompt and response finetuning, the valid
[rank0]: prompt keys are {'prompt'} and the valid response keys are {'response',
[rank0]: 'completion'}. For chat finetuning, the allowed keys are {'messages'}

hf-nopeft-noseqpar-8b-noloadpath-4yxvUW for bad example type:

raises MisconfiguredHfDatasetException

hf-nopeft-noseqpar-8b-noloadpath-fIpZH0 for bad messages type:

raises MisconfiguredHfDatasetException

Because HF catches the misconfiguration before foundry, I added some unit tests to make sure the correct error is raised in the UC case.

@milocress milocress requested a review from dakinggg August 8, 2024 15:40
@milocress milocress merged commit 805cf83 into mosaicml:main Aug 8, 2024
9 checks passed
@milocress milocress deleted the milo/fix-errors branch August 8, 2024 18:23
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