Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ONNX Runtime cache usage for decoders, add relevant tests #756

Merged
merged 3 commits into from
Feb 9, 2023

Conversation

fxmarty
Copy link
Contributor

@fxmarty fxmarty commented Feb 7, 2023

This should fix at least partially #753

It seems possible that the prepare_inputs_for_generation redefined in modeling_decoder.py and modeling_seq2seq.py is not valid for some models that do some special preprocessing before the self call in generate().

Tests are added to make sure reusing past key values is faster (on CPU).

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Feb 7, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@michaelbenayoun michaelbenayoun left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@echarlaix echarlaix left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @fxmarty

@fxmarty fxmarty merged commit 4d3ec82 into huggingface:main Feb 9, 2023
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.

4 participants