KEMBAR78
Harmonize `past_key_value` to `past_key_valueS` everywhere by Cyrilvallez · Pull Request #39956 · huggingface/transformers · GitHub
Skip to content

Conversation

@Cyrilvallez
Copy link
Member

@Cyrilvallez Cyrilvallez commented Aug 6, 2025

As per the title. I'm getting annoyed to see both, it was time to finally make it coherent everywhere.
All the changes are made, so I'll only need to remove the decorators after next release (it's only internal modules, so no need for a long deprecation cycle)

Also reapplied modular to examples/modular-transformer

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Cyrilvallez Cyrilvallez changed the title Harmonize past_key_value to past_key_values everywhere Harmonize past_key_value to past_key_valueS everywhere Aug 6, 2025
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is breaking! Let's add just 1 deprecation cycle, it does not cost much IMO!

Comment on lines 73 to 77
if "past_key_value" in kwargs and kwargs["past_key_value"] is not None:
kwargs["past_key_value"] = None
message += " `past_key_value=None`,"
do_warn = True

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to not break we still nedd this no?

Copy link
Member Author

@Cyrilvallez Cyrilvallez Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm good catch, since the decorator will change the name correctly on the forward args but this is __call__ of the Module, I believe it should indeed still be there!

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2025

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

run-slow: arcee, aria, autoformer, bamba, bart, bert, bert_generation, big_bird, bigbird_pegasus, biogpt, bitnet, blenderbot, blenderbot_small

@Cyrilvallez Cyrilvallez merged commit 5c3fb7f into main Aug 8, 2025
25 checks passed
@Cyrilvallez Cyrilvallez deleted the past-kv branch August 8, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants