Skip to content

Fix confusing warning in EncoderDecoderModel when creating decoder_input_ids from labels#41724

Open
st81 wants to merge 3 commits intohuggingface:mainfrom
st81:fix_confusing_warning_encoder_decoder_model
Open

Fix confusing warning in EncoderDecoderModel when creating decoder_input_ids from labels#41724
st81 wants to merge 3 commits intohuggingface:mainfrom
st81:fix_confusing_warning_encoder_decoder_model

Conversation

@st81
Copy link
Copy Markdown
Contributor

@st81 st81 commented Oct 19, 2025

What does this PR do?

Fixes #40168

As mentioned in the issue, it's confusing that the warning "The decoder_input_ids are now created based on the labels, no need to pass them yourself anymore" is shown even when the user doesn't pass decoder_input_ids. Fixed to show this warning only if decoder_input_ids is actually passed.

Note that the original warning message contains two parts: one about the decoder_input_ids issue, and another about the v4.12.0 change. I kept the latter warning message so it's still always shown, because it's a slight breaking change worth notifying users about (as discussed in here).

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@github-actions
Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: encoder_decoder

@st81 st81 changed the title Fix confusing warning in EncoderDecoderModel when computing loss with labels Fix confusing warning in EncoderDecoderModel when creating decoder_input_ids from labels Oct 19, 2025
@NielsRogge
Copy link
Copy Markdown
Collaborator

cc @ArthurZucker is this warning still necessary given v5 is on the roadmap?

@st81
Copy link
Copy Markdown
Contributor Author

st81 commented Oct 29, 2025

@ArthurZucker cc @NielsRogge

This PR has been open for about a week now. Would you mind taking a look when you get a chance? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants