transformers icon indicating copy to clipboard operation
transformers copied to clipboard

whisper model's default task should be "transcribe"

Open chenht2021 opened this issue 2 years ago • 1 comments

System Info

  • transformers version: 4.27.2
  • Platform: Linux-3.10.0-1062.9.1.el7.x86_64-x86_64-with-glibc2.17
  • Python version: 3.9.16
  • Huggingface_hub version: 0.13.2
  • PyTorch version (GPU?): 1.12.1 (True)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Who can help?

@sanchit-gandhi @ArthurZucker

Information

  • [X] The official example scripts
  • [ ] My own modified scripts

Tasks

  • [X] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • [ ] My own task or dataset (give details below)

Reproduction

In transformers v4.26.1, the following script will output right language, some chinese text. It's the right task "transcribe". However, in version 4.27.2, it will output translated english text, which is another task "translate".

Expected behavior

Do ASR, and Output chinese

chenht2021 avatar Mar 23 '23 07:03 chenht2021

cc @ArthurZucker and @sanchit-gandhi 🙏

ydshieh avatar Mar 23 '23 07:03 ydshieh

Hey! As you can see here the default (if the generation_config does not have a task set is still transcribe. What changed is the configuration.json see this commit where the default went from transcribe ( 50358) to translate (50359 in the forced_decoder_ids). The update in transformers just makes sure to properly use this, while the previous version did not take it into account.

ArthurZucker avatar Mar 28 '23 11:03 ArthurZucker

This is more a fix than a breaking change IMO

ArthurZucker avatar Mar 28 '23 11:03 ArthurZucker

Thank you for your explanation.

chenht2021 avatar Mar 29 '23 09:03 chenht2021