Improve --model argument handling and help message #1764
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.
This PR introduces the following updates to the
whisper/transcribe.py
script:Enhancement of the
--model
argument handling and help message: The--model
argument now provides a list of available model choices along with the default option when the--help
flag is used. This enhances user experience by providing immediate visibility of the available options.--model MODEL name of the Whisper model to use (default: small)
--model MODEL name of the Whisper model to use. Available models are: tiny.en, tiny, base.en, base, small.en, small, medium.en, medium, large-v1, large-v2, large-v3, large. You can also specify a path to a model checkpoint. (default: small)
choices=available_models()
option was not used to allow the use of custom model checkpoints.Improved error message for incorrect model names: If a non-existing model name is used, the error message now functions as intended and indicates the error and provides the list of valid model names.
whisper: error: argument --model: invalid valid_model_name value: 'some_incorrect_model_name'
whisper: error: argument --model: model should be one of ['tiny.en', 'tiny', 'base.en', 'base', 'small.en', 'small', 'medium.en', 'medium', 'large-v1', 'large-v2', 'large-v3', 'large'] or path to a model checkpoint