Skip to content

Possible bug in forced_decoder_ids in modeling_whisper.py #23926

Description

@akuzeee

System Info

N/A

Who can help?

@sanchit-gandhi @connor-henderson

Hi, thank you for the great work!

might have a bug (which is introduced in this PR).

According to a comparison with openAI's whisper, I think the order of the elements should be as follows:

            forced_decoder_ids = [
                # Slicing the text prompt ids in a manner consistent with the OpenAI implementation
                # to accomodate context space for the prefix (see https://github.com/openai/whisper/blob/c09a7ae299c4c34c5839a76380ae407e7d785914/whisper/decoding.py#L599)
                generation_config.decoder_start_token_id,
                *text_prompt_ids[-self.config.max_length // 2 - 1 :],
                *[token for _rank, token in non_prompt_forced_decoder_ids],
            ]

Information

  • The official example scripts
  • My own modified scripts

Tasks

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

Reproduction

N/A

Expected behavior

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions