[eval] fix check for language arg#139
Open
sanchit-gandhi wants to merge 1 commit into
Open
Conversation
sanchit-gandhi
commented
Jun 18, 2024
| # 8. Preprocessing the datasets. | ||
| # We need to read the audio files as arrays and tokenize the targets. | ||
| audio_column_name = data_args.audio_column_name | ||
| language = language_to_id(data_args.language, model.generation_config) if data_args.language else None |
Contributor
Author
There was a problem hiding this comment.
The issue previously was that we could have passed the language arg for an English-only checkpoint, which is invalid. We now check this case first, and then set the normalizer afterwards
sanchit-gandhi
commented
Jun 18, 2024
Comment on lines
+570
to
+574
| elif data_args.language is not None: | ||
| raise ValueError( | ||
| "Setting language token for an English-only checkpoint is not permitted. The language argument should " | ||
| "only be set for multilingual checkpoints." | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
Informative error that will be thrown if language is passed but the checkpoint is English-only
eustlb
approved these changes
Jun 27, 2024
eustlb
left a comment
Collaborator
There was a problem hiding this comment.
Solve this edge case but also improves readability, thanks @sanchit-gandhi !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes distil-medium.en/discussions/14 by re-ordering the set-up steps such that we:
Doing 1 before 2 means we can be certain here that if the language arg is passed, we are dealing with a multilingual checkpoint.