huggingface / distil-whisper

Distilled variant of Whisper for speech recognition. 6x faster, 50% smaller, within 1% word error rate.
MIT License
3.32k stars 238 forks source link

[eval] fix check for language arg #139

Open sanchit-gandhi opened 1 week ago

sanchit-gandhi commented 1 week ago

Fixes distil-medium.en/discussions/14 by re-ordering the set-up steps such that we:

  1. Set the generation config args, throwing an error if we get a language arg for an English-only checkpoint
  2. Define the normalizer after the generation config is set

Doing 1 before 2 means we can be certain here that if the language arg is passed, we are dealing with a multilingual checkpoint.